From 688daf9843fb74e6156c34acb5d9f30404577b40 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 8 Feb 2019 17:39:46 +0100 Subject: [PATCH] Core/SAI: stop movement on CombatMove cast flags and fixed an issue that was causing npc's with smart scripts ignoring controlled motion slots --- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 566cebe176..12b6ee3bb3 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -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(); + } } }