- SW: Fix DoPlayerDeathHoriz() with unsynchronised input.

This commit is contained in:
Mitchell Richters 2020-09-08 18:12:45 +10:00
parent 083ed3e9b7
commit cda79496ce
2 changed files with 3 additions and 9 deletions

View file

@ -1651,7 +1651,7 @@ drawscreen(PLAYERp pp, double smoothratio)
tz = camerapp->oposz + xs_CRoundToInt(fmulscale16(camerapp->posz - camerapp->oposz, smoothratio));
// TODO: It'd be better to check pp->input.q16angvel instead, problem is that
// it's been repurposed for the q16ang diff while tying input to framerate
if (cl_syncinput || (pp != Player+myconnectindex) || TEST(pp->Flags, PF_DEAD))
if (cl_syncinput || pp != Player+myconnectindex)
{
tq16ang = camerapp->oq16ang + xs_CRoundToInt(fmulscale16(NORM_Q16ANGLE(camerapp->q16ang + IntToFixed(1024) - camerapp->oq16ang) - IntToFixed(1024), smoothratio));
tq16horiz = camerapp->oq16horiz + xs_CRoundToInt(fmulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio));

View file

@ -6278,20 +6278,14 @@ DoPlayerBeginDie(PLAYERp pp)
void
DoPlayerDeathHoriz(PLAYERp pp, short target, short speed)
{
if (pp->q16horiz > IntToFixed(target))
if ((pp->q16horiz - IntToFixed(target)) > FRACUNIT)
{
playerAddHoriz(pp, -speed);
if (pp->q16horiz <= IntToFixed(target))
playerSetHoriz(pp, target);
}
if (pp->q16horiz < IntToFixed(target))
if ((IntToFixed(target) - pp->q16horiz) > FRACUNIT)
{
playerAddHoriz(pp, speed);
if (pp->q16horiz >= IntToFixed(target))
playerSetHoriz(pp, target);
}
}