diff options
| author | treeston <treeston.mmoc@gmail.com> | 2015-12-16 20:33:09 +0100 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2016-05-03 13:23:18 +0200 |
| commit | 26b084a90ff3e4f0601e72c283bd3296d4640585 (patch) | |
| tree | 6f1c40391e7bbdef10e9c90d37ecab4910326daa /src/server/game/AI/SmartScripts | |
| parent | d82534a7bbd401f4b672786749f10f5a95f6e76c (diff) | |
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.
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 8e9bd7cdff7..2bf97086957 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -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); } |
