Remove redundant P_CyclePlayerMobjState function

This commit is contained in:
Gustaf Alhäll 2025-01-19 18:03:35 +01:00
parent 5d79cf674c
commit 8f388ef9ae

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
// Returns true if the mobj is still present.
@ -3803,7 +3782,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
}
animonly:
P_CyclePlayerMobjState(mobj);
P_CycleMobjState(mobj);
}
static void CalculatePrecipFloor(precipmobj_t *mobj)
@ -10334,10 +10313,7 @@ void P_MobjThinker(mobj_t *mobj)
}
// 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))
return;