Core/AI: EscortAI::SetRun now also adjusts already-in-progress waypoint paths, as opposed to only affecting future path loading.
Port From (https://github.com/TrinityCore/TrinityCore/commit/58000148d321d1f0dde96667974ea912e0a8356e)
This commit is contained in:
@@ -358,10 +358,13 @@ namespace Game.AI
|
||||
|
||||
public void SetRun(bool on = true)
|
||||
{
|
||||
if (on && !_running)
|
||||
me.SetWalk(false);
|
||||
else if (!on && _running)
|
||||
me.SetWalk(true);
|
||||
if (on == _running)
|
||||
return;
|
||||
|
||||
foreach (var node in _path.nodes)
|
||||
node.moveType = on ? WaypointMoveType.Run : WaypointMoveType.Walk;
|
||||
|
||||
me.SetWalk(!on);
|
||||
|
||||
_running = on;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user