# HG changeset patch # User peter1138 # Date 2008-02-01 22:13:59 # Node ID 1874b30da9a201cab9fc677e080dbf2020d4bbfc # Parent 0ea88f22d4aa8b6885ff2756e8da60b90896951e (svn r12038) -Fix: Change ownership of or remove statues when merging/bankrupting companies. diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -449,6 +449,19 @@ static void ChangeTileOwner_Unmovable(Ti if (IsOwnedLand(tile) && new_player != PLAYER_SPECTATOR) { SetTileOwner(tile, new_player); + } else if (IsStatueTile(tile)) { + TownID town = GetStatueTownID(tile); + Town *t = GetTown(town); + ClrBit(t->statues, old_player); + if (new_player != PLAYER_SPECTATOR && !HasBit(t->statues, new_player)) { + /* Transfer ownership to the new company */ + SetBit(t->statues, new_player); + SetTileOwner(tile, new_player); + } else { + DoClearSquare(tile); + } + + InvalidateWindow(WC_TOWN_AUTHORITY, town); } else { DoClearSquare(tile); }