From 7a78a1b51ab209e67b95183a9cffc1a1c0e44fff Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 1 Feb 2008 22:13:59 +0000 Subject: (svn r12038) -Fix: Change ownership of or remove statues when merging/bankrupting companies. --- src/unmovable_cmd.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index b73e099a5..32f6ff993 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -449,6 +449,19 @@ static void ChangeTileOwner_Unmovable(TileIndex tile, PlayerID old_player, Playe 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); } -- cgit v1.2.3-70-g09d2