Core/AI: Fix remaining charming issue
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on) (cherry picked from commit 69809d12031d055d8d0cffb5a187d9af09dd0efe)
This commit is contained in:
@@ -70,6 +70,9 @@ void CreatureAI::OnCharmed(bool isNew)
|
||||
}
|
||||
|
||||
me->LastCharmerGUID.Clear();
|
||||
|
||||
if (!me->IsInCombat())
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
UnitAI::OnCharmed(isNew);
|
||||
|
||||
@@ -708,6 +708,9 @@ void SmartAI::OnCharmed(bool /*isNew*/)
|
||||
if (Unit* lastCharmer = ObjectAccessor::GetUnit(*me, me->LastCharmerGUID))
|
||||
me->EngageWithTarget(lastCharmer);
|
||||
me->LastCharmerGUID.Clear();
|
||||
|
||||
if (!me->IsInCombat())
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user