(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:
rubidium
2014-10-04 19:23:43 +00:00
parent d3332d106b
commit 67991b70f0
3 changed files with 9 additions and 3 deletions

View File

@@ -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;