Changeset - r19939:167f99380426
[Not reviewed]
master
0 1 0
planetmaker - 11 years ago 2013-01-08 17:56:43
planetmaker@openttd.org
(svn r24895) -Fix [FS#5436]: Allow downgrade of road bridges in the scenario editor
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -302,15 +302,16 @@ CommandCost CmdBuildBridge(TileIndex end
 

	
 
		/* If this is a railway bridge, make sure the railtypes match. */
 
		if (transport_type == TRANSPORT_RAIL && GetRailType(tile_start) != railtype) {
 
			return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 
		}
 

	
 
		/* Do not replace town bridges with lower speed bridges. */
 
		/* Do not replace town bridges with lower speed bridges, unless in scenario editor. */
 
		if (!(flags & DC_QUERY_COST) && IsTileOwner(tile_start, OWNER_TOWN) &&
 
				GetBridgeSpec(bridge_type)->speed < GetBridgeSpec(GetBridgeType(tile_start))->speed) {
 
				GetBridgeSpec(bridge_type)->speed < GetBridgeSpec(GetBridgeType(tile_start))->speed &&
 
				_game_mode != GM_EDITOR) {
 
			Town *t = ClosestTownFromTile(tile_start, UINT_MAX);
 

	
 
			if (t == NULL) {
 
				return CMD_ERROR;
 
			} else {
 
				SetDParam(0, t->index);
0 comments (0 inline, 0 general)