From 812886ca618b39b36e85f23e5056398e26123645 Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 8 Apr 2019 19:20:43 +0100 Subject: Fix #7478: Don't remove NewGRF objects on company take-over. (#7483) --- src/object_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/object_cmd.cpp') diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 92e6d6ab2..a57aa57f0 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -768,9 +768,10 @@ static void ChangeTileOwner_Object(TileIndex tile, Owner old_owner, Owner new_ow bool do_clear = false; - if (IsObjectType(tile, OBJECT_OWNED_LAND) && new_owner != INVALID_OWNER) { + ObjectType type = GetObjectType(tile); + if ((type == OBJECT_OWNED_LAND || type >= NEW_OBJECT_OFFSET) && new_owner != INVALID_OWNER) { SetTileOwner(tile, new_owner); - } else if (IsObjectType(tile, OBJECT_STATUE)) { + } else if (type == OBJECT_STATUE) { Town *t = Object::GetByTile(tile)->town; ClrBit(t->statues, old_owner); if (new_owner != INVALID_OWNER && !HasBit(t->statues, new_owner)) { -- cgit v1.2.3-54-g00ecf