mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 17:21:24 +00:00
Disable angle interp on fresh mobjs
This commit is contained in:
parent
34eebcb4b8
commit
50b0c29db9
3 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue