diff options
author | rubidium <rubidium@openttd.org> | 2010-08-13 11:58:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-13 11:58:45 +0000 |
commit | c5ec91098016e92a4872216c77380e522262abc3 (patch) | |
tree | b3761b4425c7e9f2b17ea70951334015a5236f61 /src/town_cmd.cpp | |
parent | a7beb897e22ca3101b02cc29d4e378c062b8989f (diff) | |
download | openttd-c5ec91098016e92a4872216c77380e522262abc3.tar.xz |
(svn r20481) -Fix: statues were not removed when towns would be removed
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 365d64780..85e797215 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -89,6 +89,10 @@ Town::~Town() assert(!IsTileOwner(tile, OWNER_TOWN) || ClosestTownFromTile(tile, UINT_MAX) != this); break; + case MP_OBJECT: + assert(GetObjectType(tile) != OBJECT_STATUE || GetStatueTownID(tile) != this->index); + break; + default: break; } @@ -2398,6 +2402,10 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 try_clear = Industry::GetByTile(tile)->town == t; break; + case MP_OBJECT: + try_clear = GetObjectType(tile) == OBJECT_STATUE && GetStatueTownID(tile) == t->index; + break; + default: break; } |