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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user