fix(Core/Formations): fixed possible finite loop related to GROUP_AI_FLAG_EVADE_TOGETHER (#9279)

This commit is contained in:
Andrius Peleckas
2021-11-26 04:46:12 +02:00
committed by GitHub
parent 4942012db9
commit 36fc50e1a8
3 changed files with 14 additions and 20 deletions

View File

@@ -314,15 +314,14 @@ bool CreatureAI::_EnterEvadeMode()
me->SetLastDamagedTime(0);
me->SetCannotReachTarget(false);
if (CreatureGroup* formation = me->GetFormation())
{
formation->MemberEvaded(me);
}
if (me->IsInEvadeMode())
{
return false;
}
else if (CreatureGroup* formation = me->GetFormation())
{
formation->MemberEvaded(me);
}
return true;
}