aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2018-04-20 12:46:24 +0200
committerccrs <ccrs@users.noreply.github.com>2018-04-20 12:46:24 +0200
commitbcab5bc4e7ac3866e86a54a1aa17e1174672ce75 (patch)
tree1733f13f4653868a858b151d31808e8f906f8756 /src
parenta5df77a9d6f3e48f2c4e8a61d60e3b5f2f0c326e (diff)
Core/Movement: crashfix
New movement -> Mutate -> Finish current for that slot that happens to be the same type, Follow -> Finish method on the removed movement -> UpdateSpeed call -> search for top -> crash Closes #21861
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/MotionMaster.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index a13785dbd00..122b7399ff4 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -161,9 +161,13 @@ void MotionMaster::MovementExpired(bool reset /*= true*/)
MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType() const
{
if (empty())
- return IDLE_MOTION_TYPE;
+ return MAX_MOTION_TYPE;
+
+ MovementGenerator* movement = top();
+ if (!movement)
+ return MAX_MOTION_TYPE;
- return top()->GetMovementGeneratorType();
+ return movement->GetMovementGeneratorType();
}
MovementGeneratorType MotionMaster::GetMotionSlotType(MovementSlot slot) const