From e1eae802e3a74245a3fb0ae7537a1ae875adde23 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 20 Nov 2010 13:28:10 +0100 Subject: Core/SmartAI: ACTION_RANDOM_MOVE with distance = 0 should reset motion back to IDLE --HG-- branch : trunk --- src/server/game/AI/SmartScripts/SmartScript.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 9d505522a2c..b74bc2e78bd 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1155,7 +1155,12 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u if (!targets) return; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) if (IsCreature((*itr))) - (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); + { + if (e.action.moveRandom.distance) + (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); + else + (*itr)->ToCreature()->GetMotionMaster()->MoveIdle(); + } break; } default: -- cgit v1.2.3