diff options
author | peter1138 <peter1138@openttd.org> | 2008-01-23 08:47:49 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-01-23 08:47:49 +0000 |
commit | 0f966a316a508a8a066eb5512da7dc6eab75b2f3 (patch) | |
tree | 31f12ebbde0427fad2e231d4b810e6d2b5a7dcb1 /src | |
parent | ff0891426f9f067a376a369f45c94573a93d7679 (diff) | |
download | openttd-0f966a316a508a8a066eb5512da7dc6eab75b2f3.tar.xz |
(svn r11956) -Fix [FS#1675]: Disallow building locks and docks on rapids.
Diffstat (limited to 'src')
-rw-r--r-- | src/station_cmd.cpp | 3 | ||||
-rw-r--r-- | src/water_cmd.cpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 316403043..8b30d98de 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1954,6 +1954,9 @@ CommandCost CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) default: return_cmd_error(STR_304B_SITE_UNSUITABLE); } + /* Docks cannot be placed on rapids */ + if (IsRiverTile(tile)) return_cmd_error(STR_304B_SITE_UNSUITABLE); + if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR; if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 681ccb331..abb68dce9 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -285,6 +285,10 @@ CommandCost CmdBuildLock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) case SLOPE_NE: dir = DIAGDIR_NE; break; default: return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION); } + + /* Disallow building of locks on river rapids */ + if (IsRiverTile(tile)) return_cmd_error(STR_0239_SITE_UNSUITABLE); + return DoBuildShiplift(tile, dir, flags); } |