Mercurial > hg > openttd
changeset 6306:0e06c28cf44e draft
(svn r9178) -Fix (r7573) [FS#679]: Don't allow building docks or buoys under bridges.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Wed, 14 Mar 2007 12:56:09 +0000 |
parents | 13842c0ef6a9 |
children | 976dd5249c0e |
files | src/station_cmd.cpp |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1629,6 +1629,7 @@ 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 @@ 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 @@ 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;