(svn r21780) -Change: Keep aqueducts and road/tram tunnels and bridges after removing a company.

pull/155/head
terkhen 14 years ago
parent d865c6ea02
commit fbad07d3df

@ -1485,12 +1485,13 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner
if (new_owner != INVALID_OWNER) { if (new_owner != INVALID_OWNER) {
SetTileOwner(tile, new_owner); SetTileOwner(tile, new_owner);
} else { } else {
if (DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR).Failed()) { if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
/* When clearing the bridge/tunnel failed there are still vehicles on/in /* Since all of our vehicles have been removed, it is safe to remove the rail
* the bridge/tunnel. As all *our* vehicles are already removed, they * bridge / tunnel. */
* must be of another owner. Therefore this can't be rail tunnel/bridge. CommandCost ret = DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
* In that case we can safely reassign the ownership to OWNER_NONE. */ assert(ret.Succeeded());
assert(GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL); } else {
/* In any other case, we can safely reassign the ownership to OWNER_NONE. */
SetTileOwner(tile, OWNER_NONE); SetTileOwner(tile, OWNER_NONE);
} }
} }

Loading…
Cancel
Save