From 203bbfd3b7e3592151a5d0ee20e2c6c9a8d39d04 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 24 Aug 2020 11:37:57 -0400 Subject: [PATCH] Core/Movement: PropagateSpeedChange should only be called on the top (current active) movement generator Port From (https://github.com/TrinityCore/TrinityCore/commit/b521bf1d3a4e59abf0d7c15200de5fff7430d2ed) --- Source/Game/Movement/MotionMaster.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Game/Movement/MotionMaster.cs b/Source/Game/Movement/MotionMaster.cs index 48216bbb0..7f984a4ec 100644 --- a/Source/Game/Movement/MotionMaster.cs +++ b/Source/Game/Movement/MotionMaster.cs @@ -157,11 +157,14 @@ namespace Game.Movement public void PropagateSpeedChange() { - for (int i = 0; i <= _top; ++i) - { - if (_slot[i] != null) - _slot[i].UnitSpeedChanged(); - } + if (Empty()) + return; + + IMovementGenerator movement = Top(); + if (movement == null) + return; + + movement.UnitSpeedChanged(); } public bool GetDestination(out float x, out float y, out float z)