1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

SectorMap::exploreNewSector: only store visible visitable objects

Fix crash that I initially missed. AI unable to access information about hidden objects like events via callbacks so we shouldn't store them here too.
This commit is contained in:
Arseniy Shestakov 2016-08-18 03:33:23 +03:00
parent e4091c05ec
commit c931fa5081

View File

@ -3061,7 +3061,8 @@ void SectorMap::exploreNewSector(crint3 pos, int num, CCallback * cbp)
if(t->visitable)
{
auto obj = t->visitableObjects.front();
s.visitableObjs.push_back(obj);
if(cb->getObj(obj->id, false)) // FIXME: we have to filter invisible objcts like events, but probably TerrainTile shouldn't be used in SectorMap at all
s.visitableObjs.push_back(obj);
}
}
}