Core/SmartAI: ACTION_RANDOM_MOVE with distance = 0 should reset motion back to IDLE

--HG--
branch : trunk
This commit is contained in:
Rat
2010-11-20 13:28:10 +01:00
parent e3c6723a8d
commit e1eae802e3

View File

@@ -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: