DjWarmonger 11 年之前
父節點
當前提交
95e442898e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      AI/VCAI/VCAI.cpp

+ 5 - 0
AI/VCAI/VCAI.cpp

@@ -1512,6 +1512,11 @@ void VCAI::validateVisitableObjs()
 	errorMsg = " shouldn't be on the visitable objects list!";
 	erase_if(visitableObjs, shouldBeErased);
 
+	//FIXME: how comes our own heroes become inaccessible?
+	erase_if(reservedHeroesMap, [](std::pair<HeroPtr, std::set<const CGObjectInstance *>> hp) -> bool
+	{
+		return !hp.first.get(true);
+	});
 	for(auto &p : reservedHeroesMap)
 	{
 		errorMsg = " shouldn't be on list for hero " + p.first->name + "!";