2
0
Michał W. Urbańczyk 12 жил өмнө
parent
commit
0e8fa04d9f
1 өөрчлөгдсөн 5 нэмэгдсэн , 2 устгасан
  1. 5 2
      AI/VCAI/VCAI.cpp

+ 5 - 2
AI/VCAI/VCAI.cpp

@@ -2759,8 +2759,11 @@ void AIStatus::heroVisit(const CGObjectInstance *obj, bool started)
 		objectsBeingVisited.push_back(obj);
 	else
 	{
-		assert(objectsBeingVisited.size() == 1);
-		objectsBeingVisited.clear();
+		// There can be more than one object visited at the time (eg. hero visits Subterranean Gate 
+		// causing visit to hero on the other side. 
+		// However, we are guaranteed that start/end visit notification maintain stack order.
+		assert(!objectsBeingVisited.empty());
+		objectsBeingVisited.pop_back();
 	}
 	cv.notify_all();
 }