aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/SmartScripts
diff options
context:
space:
mode:
authorMalcrom <malcromdev@gmail.com>2013-12-12 18:09:07 -0330
committerMalcrom <malcromdev@gmail.com>2013-12-12 18:09:07 -0330
commit9f741432a3b049183e80de72bd569c3af29feaf9 (patch)
treef0edd1195bb9c2dee3080643ab41dfb06fc16d01 /src/server/game/AI/SmartScripts
parent9d953511187d65d23c0d3dab2ebd8747319b32dd (diff)
Core/AI: Some code cleanup
Diffstat (limited to 'src/server/game/AI/SmartScripts')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index ef82c5022fe..296090a4378 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -597,6 +597,9 @@ void SmartAI::EnterCombat(Unit* enemy)
me->InterruptNonMeleeSpells(false); // must be before ProcessEvents
GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy);
me->GetPosition(&mLastOOCPos);
+ SetRun(mRun);
+ if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
}
void SmartAI::JustDied(Unit* killer)
@@ -620,14 +623,8 @@ void SmartAI::AttackStart(Unit* who)
{
if (who && me->Attack(who, me->IsWithinMeleeRange(who)))
{
- SetRun(mRun);
- if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
- me->GetMotionMaster()->MovementExpired();
-
if (mCanCombatMove)
me->GetMotionMaster()->MoveChase(who);
-
- me->GetPosition(&mLastOOCPos);
}
}