diff --git a/src/p_local.h b/src/p_local.h index 1064c9ab6..425a85030 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -286,7 +286,14 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 aimtype #ifdef SEENAMES #define P_SpawnNameFinder(s,t) P_SPMAngle(s,t,s->angle,true,0) #endif -SINT8 P_MobjFlip(const mobj_t *mobj); + +// P_MobjFlip +// Special utility to return +1 or -1 depending on mobj's gravity +FUNCINLINE static ATTRINLINE SINT8 P_MobjFlip(const mobj_t *mobj) +{ + return (mobj && mobj->eflags & MFE_VERTICALFLIP) ? -1 : 1; +} + fixed_t P_GetMobjGravity(mobj_t *mo); FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type); diff --git a/src/p_mobj.c b/src/p_mobj.c index 67f31c294..8b350849d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -91,6 +91,7 @@ FUNCINLINE static ATTRINLINE void P_CycleStateAnimation(mobj_t *mobj) // var2 determines delay between animation frames if (!(mobj->frame & FF_ANIMATE) || --mobj->anim_duration != 0) return; + mobj->anim_duration = (UINT16)mobj->state->var2; // compare the current sprite frame to the one we started from @@ -351,18 +352,6 @@ static boolean P_SetPrecipMobjState(precipmobj_t *mobj, statenum_t state) return true; } -// -// P_MobjFlip -// -// Special utility to return +1 or -1 depending on mobj's gravity -// -SINT8 P_MobjFlip(const mobj_t *mobj) -{ - if (mobj && mobj->eflags & MFE_VERTICALFLIP) - return -1; - return 1; -} - // // P_WeaponOrPanel //