fix(Core/Formations): Implemented new creature formation flag: GROUP_… (#14537)

fix(Core/Formations): Implemented new creature formation flag: GROUP_AI_FLAG_ACQUIRE_NEW_TARGET_ON_EVADE.

Fixes #14494
This commit is contained in:
UltraNix
2023-01-19 20:08:51 +01:00
committed by GitHub
parent 484cb1d01b
commit 1de52e5570
4 changed files with 85 additions and 20 deletions

View File

@@ -14687,6 +14687,16 @@ Unit* Creature::SelectVictim()
return nullptr;
}
// Last chance: creature group
if (CreatureGroup* group = GetFormation())
{
if (Unit* groupTarget = group->GetNewTargetForMember(this))
{
SetInFront(groupTarget);
return groupTarget;
}
}
// enter in evade mode in other case
AI()->EnterEvadeMode();