1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

NKAI: stability fixes and regression

This commit is contained in:
Andrii Danylchenko
2024-04-20 10:33:37 +03:00
parent ed76d8a652
commit 3939c4b9d3
7 changed files with 52 additions and 6 deletions
+7
View File
@@ -104,6 +104,13 @@ void ExecuteHeroChain::accept(AIGateway * ai)
const CGHeroInstance * hero = node->targetHero;
HeroPtr heroPtr = hero;
if(!heroPtr.validAndSet())
{
logAi->error("Hero %s was lost. Exit hero chain.", heroPtr.name);
return;
}
if(node->parentIndex >= i)
{
logAi->error("Invalid parentIndex while executing node " + node->coord.toString());