@@ -767,28 +767,36 @@ void GenerateObjects()
}
static void ChangeTileOwner_Object(TileIndex tile, Owner old_owner, Owner new_owner)
{
if (!IsTileOwner(tile, old_owner)) return;
bool do_clear = false;
if (IsObjectType(tile, OBJECT_OWNED_LAND) && new_owner != INVALID_OWNER) {
SetTileOwner(tile, new_owner);
} else if (IsObjectType(tile, OBJECT_STATUE)) {
Town *t = Object::GetByTile(tile)->town;
ClrBit(t->statues, old_owner);
if (new_owner != INVALID_OWNER && !HasBit(t->statues, new_owner)) {
/* Transfer ownership to the new company */
SetBit(t->statues, new_owner);
} else {
ReallyClearObjectTile(Object::GetByTile(tile));
do_clear = true;
SetWindowDirty(WC_TOWN_AUTHORITY, t->index);
if (do_clear) {
/* When clearing objects, they may turn into canal, which may require transfering ownership. */
ChangeTileOwner(tile, old_owner, new_owner);
static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
ObjectType type = GetObjectType(tile);
Status change: