Core/AI: Some code cleanup

This commit is contained in:
Malcrom committed 2013-12-12 18:09:07 -03:30
1 parent 9d95351118
commit 9f741432a3
2 files changed
+10 -8

No files matched your search

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