diff options
author | maedhros <maedhros@openttd.org> | 2007-03-14 12:56:09 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-03-14 12:56:09 +0000 |
commit | 33e84b2c1ec36aa7451bf2db5c4f583d740f0021 (patch) | |
tree | 3618482cddbd3a61ecb3bee5adea737364014c1b | |
parent | 65ce0e36dbada71cb8526eed7377d57eaf8086b6 (diff) | |
download | openttd-33e84b2c1ec36aa7451bf2db5c4f583d740f0021.tar.xz |
(svn r9178) -Fix (r7573) [FS#679]: Don't allow building docks or buoys under bridges.
-rw-r--r-- | src/station_cmd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index d62b609ed..9a0ece835 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1629,6 +1629,7 @@ int32 CmdBuildBuoy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); if (!IsClearWaterTile(tile) || tile == 0) return_cmd_error(STR_304B_SITE_UNSUITABLE); + if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); /* allocate and initialize new station */ Station *st = new Station(tile); @@ -1748,6 +1749,8 @@ int32 CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) 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); + cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (CmdFailed(cost)) return CMD_ERROR; @@ -1757,6 +1760,8 @@ int32 CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) return_cmd_error(STR_304B_SITE_UNSUITABLE); } + if (MayHaveBridgeAbove(tile_cur) && IsBridgeAbove(tile_cur)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); + cost = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (CmdFailed(cost)) return CMD_ERROR; |