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

Fixes #13394
This commit is contained in:
UltraNix
2022-12-27 11:31:08 +01:00
committed by GitHub
parent 68ad89e75e
commit 233d284539
4 changed files with 78 additions and 24 deletions

View File

@@ -14676,6 +14676,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();