aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRat <none@none>2010-11-20 13:28:10 +0100
committerRat <none@none>2010-11-20 13:28:10 +0100
commite1eae802e3a74245a3fb0ae7537a1ae875adde23 (patch)
tree6c96bf105b20f0be12d93cf3f5843e0afc48b0f7 /src
parente3c6723a8dfbce8bb60fe5ad1a201f63ec07120e (diff)
Core/SmartAI: ACTION_RANDOM_MOVE with distance = 0 should reset motion back to IDLE
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp7
1 files changed, 6 insertions, 1 deletions
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: