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
This commit is contained in:
ccrs
2018-04-20 12:46:24 +02:00
parent a5df77a9d6
commit bcab5bc4e7

View File

@@ -161,9 +161,13 @@ void MotionMaster::MovementExpired(bool reset /*= true*/)
MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType() const
{
if (empty())
return IDLE_MOTION_TYPE;
return MAX_MOTION_TYPE;
return top()->GetMovementGeneratorType();
MovementGenerator* movement = top();
if (!movement)
return MAX_MOTION_TYPE;
return movement->GetMovementGeneratorType();
}
MovementGeneratorType MotionMaster::GetMotionSlotType(MovementSlot slot) const