From dfb566331390a87f01d048f57ed6d51b2f329d65 Mon Sep 17 00:00:00 2001 From: zuu Date: Sat, 12 Oct 2013 22:07:58 +0000 Subject: (svn r25849) -Codechange: Introduce IsTileFlat to not compute full slope information for situations when we only want to know if a tile is flat or not (cirdan, LordAro) --- src/station_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/station_cmd.cpp') diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index c57e4382d..19f7b3e64 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2471,7 +2471,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 TileIndex tile_cur = tile + TileOffsByDiagDir(direction); - if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur) != SLOPE_FLAT) { + if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) { return_cmd_error(STR_ERROR_SITE_UNSUITABLE); } @@ -2484,7 +2484,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (ret.Failed()) return ret; tile_cur += TileOffsByDiagDir(direction); - if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur) != SLOPE_FLAT) { + if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) { return_cmd_error(STR_ERROR_SITE_UNSUITABLE); } @@ -3069,7 +3069,7 @@ static void TileLoop_Station(TileIndex tile) break; case STATION_DOCK: - if (GetTileSlope(tile) != SLOPE_FLAT) break; // only handle water part + if (!IsTileFlat(tile)) break; // only handle water part /* FALL THROUGH */ case STATION_OILRIG: //(station part) case STATION_BUOY: -- cgit v1.2.3-70-g09d2