From 30042cac3d5ede31155ca98e0c1294dcaff7e05b Mon Sep 17 00:00:00 2001 From: Arseniy Shestakov Date: Fri, 16 Sep 2016 04:52:17 +0300 Subject: [PATCH] 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. --- AI/VCAI/VCAI.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 955b68235..ec1c4e84b 100644 --- a/AI/VCAI/VCAI.cpp +++ b/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);