Core/Movement: Allow using run when moving randomly
Port From (https://github.com/TrinityCore/TrinityCore/commit/a57ca5cea2d13bc5d5ddee11e7b8100c7afd68e1)
This commit is contained in:
@@ -138,9 +138,22 @@ namespace Game.Movement
|
||||
|
||||
owner.AddUnitState(UnitState.RoamingMove);
|
||||
|
||||
bool walk = true;
|
||||
switch (owner.GetMovementTemplate().GetRandom())
|
||||
{
|
||||
case CreatureRandomMovementType.CanRun:
|
||||
walk = owner.IsWalking();
|
||||
break;
|
||||
case CreatureRandomMovementType.AlwaysRun:
|
||||
walk = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
MoveSplineInit init = new(owner);
|
||||
init.MovebyPath(_path.GetPath());
|
||||
init.SetWalk(true);
|
||||
init.SetWalk(walk);
|
||||
int traveltime = init.Launch();
|
||||
_timer.Reset(traveltime + resetTimer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user