From 4d03ced3350005badc61074d50fc88b6f4679e45 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 30 Oct 2021 19:57:05 -0400 Subject: [PATCH] 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) --- Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index 6c8fc48ae..ab8c9c10e 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -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; }