- SW: Wrap calls that get PLAYER::PlayerPrevPosition.

This commit is contained in:
Mitchell Richters 2022-11-16 14:07:57 +11:00 committed by Christoph Oelckers
parent ad7a626b92
commit f711355f2f
3 changed files with 7 additions and 3 deletions

View file

@ -811,7 +811,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
else // Otherwise just interpolate the player sprite
{
pp = tActor->user.PlayerP;
tsp->pos = interpolatedvalue(pp->PlayerPrevPosition, pp->posGet(), interpfrac);
tsp->pos = interpolatedvalue(pp->posprevGet(), pp->posGet(), interpfrac);
tsp->angle = pp->angle.interpolatedang(interpfrac);
}
}
@ -1240,7 +1240,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
}
// Get initial player position, interpolating if required.
DVector3 tpos = interpolatedvalue(camerapp->PlayerPrevPosition, camerapp->posGet(), interpfrac);
DVector3 tpos = interpolatedvalue(camerapp->posprevGet(), camerapp->posGet(), interpfrac);
if (SyncInput() || pp != Player+myconnectindex)
{
tang = camerapp->angle.interpolatedsum(interpfrac);

View file

@ -760,6 +760,10 @@ struct PLAYER
{
PlayerPrevPosition = val;
}
DVector3 posprevGet()
{
return PlayerPrevPosition;
}
};
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];

View file

@ -598,7 +598,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio)
// If player is dead still then update at MoveSkip4
// rate.
if (pp->posGet() == pp->PlayerPrevPosition)
if (pp->posGet() == pp->posprevGet())
DoCam = true;