Selaa lähdekoodia

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.
Arseniy Shestakov 9 vuotta sitten
vanhempi
sitoutus
c931fa5081
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      AI/VCAI/VCAI.cpp

+ 2 - 1
AI/VCAI/VCAI.cpp

@@ -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);
 					}
 				}
 			}