From 355dc0740144c3bc085628056b113278c02cce3d Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 20 Jan 2025 15:19:43 +0100 Subject: [PATCH] code dupe P_CyclePlayerMobjState --- src/p_mobj.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ef9e43ca2..dcc809208 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -126,10 +126,11 @@ static void P_CycleMobjState(mobj_t *mobj) // // P_CycleMobjState for players. // -static void P_CyclePlayerMobjState(mobj_t *mobj) +static void P_CyclePlayerMobjState(mobj_t *mobj, boolean animonly) { // state animations - P_CycleStateAnimation(mobj); + if (!animonly) + P_CycleStateAnimation(mobj); // cycle through states, // calling action functions at transitions @@ -3630,17 +3631,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) } animonly: - // 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) - if (!P_SetPlayerMobjState(mobj, mobj->state->nextstate)) - return; // freed itself - } + P_CyclePlayerMobjState(mobj, true); } static void CalculatePrecipFloor(precipmobj_t *mobj) @@ -9244,7 +9235,7 @@ void P_MobjThinker(mobj_t *mobj) // Can end up here if a player dies. if (mobj->player) - P_CyclePlayerMobjState(mobj); + P_CyclePlayerMobjState(mobj, false); else P_CycleMobjState(mobj);