瀏覽代碼

VCAI::performTypicalActions: always check that hero is still available

It's weird why this only appear now so if you have ideas check issue 2479.
Arseniy Shestakov 9 年之前
父節點
當前提交
30042cac3d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      AI/VCAI/VCAI.cpp

+ 3 - 0
AI/VCAI/VCAI.cpp

@@ -2517,6 +2517,9 @@ void VCAI::performTypicalActions()
 {
 	for(auto h : getUnblockedHeroes())
 	{
+		if(!h) //hero might be lost. getUnblockedHeroes() called once on start of turn
+			continue;
+
 		logAi->debugStream() << boost::format("Looking into %s, MP=%d") % h->name.c_str() % h->movement;
 		makePossibleUpgrades(*h);
 		pickBestArtifacts(*h);