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

(cherry picked from commit bcab5bc4e7ac3866e86a54a1aa17e1174672ce75)
This commit is contained in:
ccrs
2021-09-26 01:43:24 +02:00
committed by Shauren
parent 068b340b69
commit d376058dcc
+6 -2
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