diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-08-19 19:28:09 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-10-22 00:40:20 +0200 |
commit | 58000148d321d1f0dde96667974ea912e0a8356e (patch) | |
tree | 5f8cae9f52a6f9e0cd911d242e64ce4277a6c22e /src | |
parent | 9a3495270544a197f0322dc8cdaef81c9fb0efe2 (diff) |
Core/AI: EscortAI::SetRun now also adjusts already-in-progress waypoint paths, as opposed to only affecting future path loading. Closes #21290.
(cherry picked from commit 121346f1f9d058079e662ce77c63f1d13b13517f)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index fd9c7421c0f..a3231bc79b3 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -350,11 +350,13 @@ void EscortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, void EscortAI::SetRun(bool on) { - if (on && !_running) - me->SetWalk(false); - else if (!on && _running) - me->SetWalk(true); + if (on == _running) + return; + + for (auto& node : _path.nodes) + node.moveType = on ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK; + me->SetWalk(!on); _running = on; } |