Disable angle interp on fresh mobjs

This commit is contained in:
Eidolon 2022-04-28 18:46:02 -05:00
parent 34eebcb4b8
commit 50b0c29db9
3 changed files with 7 additions and 2 deletions

View file

@ -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. // Tells MobjCheckWater that the water height was not set.
mobj->watertop = INT32_MAX; mobj->watertop = INT32_MAX;
mobj->resetinterp = true;
if (z == ONFLOORZ) if (z == ONFLOORZ)
{ {
mobj->z = mobj->floorz; mobj->z = mobj->floorz;

View file

@ -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?) 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 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 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 fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius

View file

@ -272,11 +272,11 @@ void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out)
if (mobj->player) 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 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_drawangle2 = mobj->player->old_drawangle;
mobj->player->old_drawangle = mobj->player->drawangle; mobj->player->old_drawangle = mobj->player->drawangle;
} }
mobj->resetinterp = false;
} }
// //