(svn r20481) -Fix: statues were not removed when towns would be removed

This commit is contained in:
rubidium
2010-08-13 11:58:45 +00:00
parent a7beb897e2
commit c5ec910980

View File

@@ -89,6 +89,10 @@ Town::~Town()
assert(!IsTileOwner(tile, OWNER_TOWN) || ClosestTownFromTile(tile, UINT_MAX) != this); assert(!IsTileOwner(tile, OWNER_TOWN) || ClosestTownFromTile(tile, UINT_MAX) != this);
break; break;
case MP_OBJECT:
assert(GetObjectType(tile) != OBJECT_STATUE || GetStatueTownID(tile) != this->index);
break;
default: default:
break; break;
} }
@@ -2398,6 +2402,10 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
try_clear = Industry::GetByTile(tile)->town == t; try_clear = Industry::GetByTile(tile)->town == t;
break; break;
case MP_OBJECT:
try_clear = GetObjectType(tile) == OBJECT_STATUE && GetStatueTownID(tile) == t->index;
break;
default: default:
break; break;
} }