Bläddra i källkod

Fixed logic discrepancy for (in)visible objects. Fixes #2224, #2225 and possibly more.

DjWarmonger 10 år sedan
förälder
incheckning
6af8db2c69
1 ändrade filer med 12 tillägg och 5 borttagningar
  1. 12 5
      AI/VCAI/VCAI.cpp

+ 12 - 5
AI/VCAI/VCAI.cpp

@@ -1659,12 +1659,19 @@ void VCAI::validateVisitableObjs()
 	std::string errorMsg;
 	auto shouldBeErased = [&](const CGObjectInstance *obj) -> bool
 	{
-		if(!vstd::contains(hlp, obj))
-		{
-			logAi->errorStream() << helperObjInfo[obj].name << " at " << helperObjInfo[obj].pos << errorMsg;
+		if (obj)
+			return !cb->getObj(obj->id);
+		else
 			return true;
-		}
-		return false;
+
+		//why would we have our local logic for object checks? use cb!
+
+		//if(!vstd::contains(hlp, obj))
+		//{
+		//	logAi->errorStream() << helperObjInfo[obj].name << " at " << helperObjInfo[obj].pos << errorMsg;
+		//	return true;
+		//}
+		//return false;
 	};
 
 	//errorMsg is captured by ref so lambda will take the new text