Merge branch 'remove-redundant-mobj-state' into 'next'

Remove redundant P_CyclePlayerMobjState function

See merge request STJr/SRB2!2601
This commit is contained in:
Lactozilla 2025-01-20 02:09:26 +00:00
commit f53086896c

View file

@ -178,27 +178,6 @@ static void P_CycleMobjState(mobj_t *mobj)
} }
} }
//
// P_CycleMobjState for players.
//
static void P_CyclePlayerMobjState(mobj_t *mobj)
{
// state animations
P_CycleStateAnimation(mobj);
// cycle through states,
// calling action functions at transitions
if (mobj->tics != -1)
{
mobj->tics--;
// you can cycle through multiple states in a tic
if (!mobj->tics && mobj->state)
if (!P_SetMobjState(mobj, mobj->state->nextstate))
return; // freed itself
}
}
// //
// P_SetPlayerMobjState // P_SetPlayerMobjState
// Returns true if the mobj is still present. // Returns true if the mobj is still present.
@ -3803,7 +3782,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
} }
animonly: animonly:
P_CyclePlayerMobjState(mobj); P_CycleMobjState(mobj);
} }
static void CalculatePrecipFloor(precipmobj_t *mobj) static void CalculatePrecipFloor(precipmobj_t *mobj)
@ -10334,9 +10313,6 @@ void P_MobjThinker(mobj_t *mobj)
} }
// Can end up here if a player dies. // Can end up here if a player dies.
if (mobj->player)
P_CyclePlayerMobjState(mobj);
else
P_CycleMobjState(mobj); P_CycleMobjState(mobj);
if (P_MobjWasRemoved(mobj)) if (P_MobjWasRemoved(mobj))