From d467ce3eb82f121e1b4c57990ac828b96efc5949 Mon Sep 17 00:00:00 2001 From: NY00123 Date: Sun, 19 Apr 2020 21:27:33 +0300 Subject: [PATCH] SW: Interpolate the player's bob_z, based on suggestion by Striker. Using pp instead of ppp seems to work better with prediction. --- source/sw/src/draw.cpp | 3 ++- source/sw/src/game.h | 2 +- source/sw/src/player.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 9d8fff331..89da7edfc 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -2142,7 +2142,8 @@ drawscreen(PLAYERp pp) if (!TEST(pp->Flags, PF_VIEW_FROM_CAMERA|PF_VIEW_FROM_OUTSIDE)) { tz += bob_amt; - tz += camerapp->bob_z; + tz += PedanticMode ? camerapp->bob_z : + pp->obob_z + mulscale16(pp->bob_z - pp->obob_z, smoothratio); // recoil only when not in camera //tq16horiz = tq16horiz + fix16_from_int(camerapp->recoil_horizoff); diff --git a/source/sw/src/game.h b/source/sw/src/game.h index bffb576cc..3a861cf4f 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -1205,7 +1205,7 @@ struct PLAYERstruct short bob_amt; short bob_ndx; short bcnt; // bob count - int bob_z; + int bob_z, obob_z; //Multiplayer variables SW_PACKET input; diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 90ce3e20d..9e3eebbff 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -7558,6 +7558,7 @@ MoveSkipSavePos(void) pp->oposz = pp->posz; pp->oq16ang = pp->q16ang; pp->oq16horiz = pp->q16horiz; + pp->obob_z = pp->bob_z; } // save off stats for skip4