(svn r26955) -Fix [FS#6126]: owner of road depot road types were not properly changed upon bankruptcy causing crashes when trying to remove the depot in certain situations
This commit is contained in:
@@ -1762,6 +1762,11 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne
|
||||
Company::Get(new_owner)->infrastructure.road[rt] += 2;
|
||||
|
||||
SetTileOwner(tile, new_owner);
|
||||
for (RoadType rt = ROADTYPE_ROAD; rt < ROADTYPE_END; rt++) {
|
||||
if (GetRoadOwner(tile, rt) == old_owner) {
|
||||
SetRoadOwner(tile, rt, new_owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
Reference in New Issue
Block a user