diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-08-19 19:28:09 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2018-08-19 19:28:09 +0200 |
commit | 121346f1f9d058079e662ce77c63f1d13b13517f (patch) | |
tree | 5e8f88f1239fcb848e40b7687ab204b21c598515 | |
parent | 96df58c4f9661a8cc0ee68482dd44137c77704a5 (diff) |
Core/AI: EscortAI::SetRun now also adjusts already-in-progress waypoint paths, as opposed to only affecting future path loading. Closes #21290.
-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 091d7a42e47..c82ad99911a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -352,11 +352,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; } |