mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix null tile being processed in CGTownInstance::updateAppearance
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user