mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Fix: Water infrastructure total when changing owner of object on water
This commit is contained in:
parent
2e7819927f
commit
85918fc23e
@ -880,6 +880,10 @@ static void ChangeTileOwner_Object(TileIndex tile, Owner old_owner, Owner new_ow
|
||||
ObjectType type = GetObjectType(tile);
|
||||
if ((type == OBJECT_OWNED_LAND || type >= NEW_OBJECT_OFFSET) && new_owner != INVALID_OWNER) {
|
||||
SetTileOwner(tile, new_owner);
|
||||
if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
|
||||
Company::Get(old_owner)->infrastructure.water--;
|
||||
Company::Get(new_owner)->infrastructure.water++;
|
||||
}
|
||||
} else if (type == OBJECT_STATUE) {
|
||||
Town *t = Object::GetByTile(tile)->town;
|
||||
ClrBit(t->statues, old_owner);
|
||||
|
Loading…
Reference in New Issue
Block a user