diff --git a/src/p_mobj.c b/src/p_mobj.c index 88c269b26..10084e06b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10593,6 +10593,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Tells MobjCheckWater that the water height was not set. mobj->watertop = INT32_MAX; + mobj->resetinterp = true; + if (z == ONFLOORZ) { mobj->z = mobj->floorz; diff --git a/src/p_mobj.h b/src/p_mobj.h index e20920181..5f65d6a72 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -393,6 +393,7 @@ typedef struct mobj_s struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?) + boolean resetinterp; // if true, some fields should not be interpolated (see R_InterpolateMobjState implementation) boolean colorized; // Whether the mobj uses the rainbow colormap boolean mirrored; // The object's rotations will be mirrored left to right, e.g., see frame AL from the right and AR from the left fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius diff --git a/src/r_fps.c b/src/r_fps.c index a897ee555..cce704245 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -272,11 +272,11 @@ void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out) if (mobj->player) { - out->angle = R_LerpAngle(mobj->player->old_drawangle, mobj->player->drawangle, frac); + out->angle = mobj->resetinterp ? mobj->player->drawangle : R_LerpAngle(mobj->player->old_drawangle, mobj->player->drawangle, frac); } else { - out->angle = R_LerpAngle(mobj->old_angle, mobj->angle, frac); + out->angle = mobj->resetinterp ? mobj->angle : R_LerpAngle(mobj->old_angle, mobj->angle, frac); } } @@ -719,6 +719,8 @@ void R_ResetMobjInterpolationState(mobj_t *mobj) mobj->player->old_drawangle2 = mobj->player->old_drawangle; mobj->player->old_drawangle = mobj->player->drawangle; } + + mobj->resetinterp = false; } //