CreatureAI: Adjust AI behavior when a charm ends. OnCharmed will be invoked on the creature's base (non-charmed) AI, allowing the AI to react to the creature no longer being charmed.
This commit is contained in:
1 parent
73fd689c1e
commit
5671f50933
7 files changed
+27
-6
No files matched your search
@@ -653,8 +653,8 @@ void SmartAI::OnCharmed(bool apply)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
|
||||
|
||||
if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID())
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
|
||||
if (!apply && !me->IsInEvadeMode())
|
||||
if (Unit* charmer = me->GetCharmer())
|
||||
AttackStart(charmer);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user