Core/SAI: stop movement on CombatMove cast flags and fixed an issue that was causing npc's with smart scripts ignoring controlled motion slots

This commit is contained in:
Ovahlord committed 2019-02-08 17:39:46 +01:00
1 parent 7edabcbd88
commit 688daf9843
1 file changed
+3 -1
+3 -1
View File
@@ -673,7 +673,6 @@ void SmartAI::AttackStart(Unit* who)
if (who && me->Attack(who, mCanAutoAttack))
{
me->GetMotionMaster()->Clear(MOTION_SLOT_ACTIVE);
me->PauseMovement();
if (mCanCombatMove)
{
@@ -875,7 +874,10 @@ void SmartAI::SetCombatMove(bool on)
me->GetMotionMaster()->MoveChase(me->GetVictim());
}
else if (!on && me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == CHASE_MOTION_TYPE)
{
me->GetMotionMaster()->Clear(MOTION_SLOT_ACTIVE);
me->StopMoving();
}
}
}