diff options
author | zuu <zuu@openttd.org> | 2013-10-12 22:07:58 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-10-12 22:07:58 +0000 |
commit | dfb566331390a87f01d048f57ed6d51b2f329d65 (patch) | |
tree | 76bcf6959e2acb63051f9f74a80b8154b95bc824 /src/station_cmd.cpp | |
parent | b35b8aa5bb38f9e47ca04ccd9302dd82546de0cd (diff) | |
download | openttd-dfb566331390a87f01d048f57ed6d51b2f329d65.tar.xz |
(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)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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: |