mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
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)
This commit is contained in:
@@ -62,6 +62,9 @@ void CreatureAI::OnCharmed(bool isNew)
|
||||
}
|
||||
|
||||
me->LastCharmerGUID.Clear();
|
||||
|
||||
if (!me->IsInCombat())
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
UnitAI::OnCharmed(isNew);
|
||||
|
||||
@@ -706,6 +706,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