Michał W. Urbańczyk 12 years ago
parent
commit
0e8fa04d9f
1 changed files with 5 additions and 2 deletions
  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();
 }