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:
treeston authored and Aokromes committed 2016-05-12 09:16:31 +02:00
1 parent 73fd689c1e
commit 5671f50933
7 files changed
+27 -6

No files matched your search

+2 -2
View File
@@ -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);
}