|
@@ -698,7 +698,15 @@ ObjectInstanceID CGTownInstance::getObjInstanceID() const
|
|
|
|
|
|
void CGTownInstance::updateAppearance()
|
|
|
{
|
|
|
- auto terrain = cb->getTile(visitablePos())->getTerrainID();
|
|
|
+ const auto tile = cb->getTile(visitablePos());
|
|
|
+ if(!tile)
|
|
|
+ {
|
|
|
+ logGlobal->warn("Town is misplaced at (%d, %d, %d)", visitablePos().x,
|
|
|
+ visitablePos().y, visitablePos().z);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ auto terrain = tile->getTerrainID();
|
|
|
//FIXME: not the best way to do this
|
|
|
auto app = getObjectHandler()->getOverride(terrain, this);
|
|
|
if (app)
|