(svn r12095) -Fix [FS#1703]: when a company bankrupts, remove drive-through road stops, ship depots and buoys too. Update owners of water and road.

This commit is contained in:
smatz
2008-02-09 17:30:13 +00:00
parent 802c949755
commit e3301db213
3 changed files with 42 additions and 14 deletions

View File

@@ -1413,7 +1413,8 @@ static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID n
}
for (RoadType rt = ROADTYPE_ROAD; rt < ROADTYPE_END; rt++) {
if (!HasBit(GetRoadTypes(tile), rt)) continue;
/* ROADTYPE_ROAD denotes the tile owner, so update it too */
if (rt != ROADTYPE_ROAD && !HasBit(GetRoadTypes(tile), rt)) continue;
if (GetRoadOwner(tile, rt) == old_player) {
SetRoadOwner(tile, rt, new_player == PLAYER_SPECTATOR ? OWNER_NONE : new_player);