diff options
author | peter1138 <peter1138@openttd.org> | 2008-02-01 22:13:59 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-02-01 22:13:59 +0000 |
commit | 7a78a1b51ab209e67b95183a9cffc1a1c0e44fff (patch) | |
tree | abb200be04b496be06263dfd2e8897ba66096c54 /src | |
parent | 525409b0fc2bf3668d2dc0228fc8d2e14a5e7a48 (diff) | |
download | openttd-7a78a1b51ab209e67b95183a9cffc1a1c0e44fff.tar.xz |
(svn r12038) -Fix: Change ownership of or remove statues when merging/bankrupting companies.
Diffstat (limited to 'src')
-rw-r--r-- | src/unmovable_cmd.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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); } |