Changeset - r6708:8f38bbf425fc
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-05-26 20:30:40
rubidium@openttd.org
(svn r9940) -Fix [FS#805]: upgrading a bridge removed roadtypes.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -295,24 +295,27 @@ int32 CmdBuildBridge(TileIndex end_tile,
 
		if (!(flags & DC_QUERY_COST) && bridge_type == GetBridgeType(tile_start)) {
 
			return_cmd_error(STR_1007_ALREADY_BUILT);
 
		}
 

	
 
		/* Do not allow replacing another player's bridges. */
 
		if (!IsTileOwner(tile_start, _current_player) && !IsTileOwner(tile_start, OWNER_TOWN)) {
 
			return_cmd_error(STR_1024_AREA_IS_OWNED_BY_ANOTHER);
 
		}
 

	
 
		cost = (bridge_len + 1) * _price.clear_bridge; // The cost of clearing the current bridge.
 
		replace_bridge = true;
 
		replaced_bridge_type = GetBridgeType(tile_start);
 

	
 
		/* Do not remove road types when upgrading a bridge */
 
		roadtypes |= GetRoadTypes(tile_start);
 
	} else {
 
		/* Build a new bridge. */
 

	
 
		/* Try and clear the start landscape */
 
		ret = DoCommand(tile_start, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
		if (CmdFailed(ret)) return ret;
 
		cost = ret;
 

	
 
		terraformcost = CheckBridgeSlopeNorth(direction, tileh_start);
 
		if (CmdFailed(terraformcost) || (terraformcost != 0 && !allow_on_slopes))
 
			return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 
		cost += terraformcost;
0 comments (0 inline, 0 general)