Mercurial > hg > openttd
changeset 16109:5e95ab62c484 draft
(svn r20802) -Fix: Building bridges on water/watery objects behaved inconsistently for towns and the bridge selection GUI.
author | frosch <frosch@openttd.org> |
---|---|
date | Mon, 13 Sep 2010 19:45:39 +0000 |
parents | 91fa0edcdf46 |
children | b943e4c9ff12 |
files | src/bridge_gui.cpp src/town_cmd.cpp src/tunnelbridge_cmd.cpp |
diffstat | 3 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -383,7 +383,7 @@ /* only query bridge building possibility once, result is the same for all bridges! * returns CMD_ERROR on failure, and price on success */ StringID errmsg = INVALID_STRING_ID; - CommandCost ret = DoCommand(end, start, type, DC_AUTO | DC_QUERY_COST, CMD_BUILD_BRIDGE); + CommandCost ret = DoCommand(end, start, type, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)) | DC_QUERY_COST, CMD_BUILD_BRIDGE); GUIBridgeList *bl = NULL; if (ret.Failed()) {
--- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1000,8 +1000,8 @@ byte bridge_type = RandomRange(MAX_BRIDGES - 1); /* Can we actually build the bridge? */ - if (DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, DC_AUTO, CMD_BUILD_BRIDGE).Succeeded()) { - DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE); + if (DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE).Succeeded()) { + DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE); _grow_town_result = GROWTH_SUCCEED; return true; }
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -257,11 +257,6 @@ if (bridge_len > (_settings_game.construction.longbridges ? 100U : 16U)) return_cmd_error(STR_ERROR_BRIDGE_TOO_LONG); } - /* retrieve landscape height and ensure it's on land */ - if (IsWaterTile(tile_start) || IsWaterTile(tile_end)) { - return_cmd_error(STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH); - } - uint z_start; uint z_end; Slope tileh_start = GetTileSlope(tile_start, &z_start);