aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/SmartScripts
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2015-12-16 20:33:09 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-07 21:05:34 +0100
commitf93730b160fbd5bf47e2abdbc86cec8780aab18e (patch)
treee9e9d415808aa4411772681686eca1a45f1dfcb2 /src/server/game/AI/SmartScripts
parent212f1a05bbf48a0eb116243637f4f22c044f9a5b (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.
(cherry picked from commit 26b084a90ff3e4f0601e72c283bd3296d4640585) align fix (cherry picked from commit 58486fc19ad51eaff2ef1a4a5ddd8edfdedec28d)
Diffstat (limited to 'src/server/game/AI/SmartScripts')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp4
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 08af757da28..9e47b1e499f 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().IsEmpty())
- if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
+ if (!apply && !me->IsInEvadeMode())
+ if (Unit* charmer = me->GetCharmer())
AttackStart(charmer);
}