diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index d333c4a6a..1224837dc 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1590,7 +1590,7 @@ drawscreen(PLAYERp pp, double smoothratio) } // recoil only when not in camera - thoriz = q16horiz(clamp(thoriz.asq16() + pp->recoil_horizoff, gi->playerHorizMin(), gi->playerHorizMax())); + thoriz = q16horiz(clamp(thoriz.asq16() + interpolatedvalue(pp->recoil_ohorizoff, pp->recoil_horizoff, smoothratio), gi->playerHorizMin(), gi->playerHorizMax())); } if (automapMode != am_full)// && !ScreenSavePic) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 3754df786..1046c9bd9 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -799,7 +799,7 @@ struct PLAYERstruct short recoil_amt; short recoil_speed; short recoil_ndx; - fixed_t recoil_horizoff; + fixed_t recoil_ohorizoff, recoil_horizoff; int oldposx,oldposy,oldposz; int RevolveX, RevolveY; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 3ad1cd437..dce57d568 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1720,7 +1720,7 @@ DoPlayerBeginRecoil(PLAYERp pp, short pix_amt) pp->recoil_amt = pix_amt; pp->recoil_speed = 80; pp->recoil_ndx = 0; - pp->recoil_horizoff = 0; + pp->recoil_ohorizoff = pp->recoil_horizoff = 0; } void @@ -1732,11 +1732,12 @@ DoPlayerRecoil(PLAYERp pp) if (bsin(pp->recoil_ndx) < 0) { RESET(pp->Flags, PF_RECOIL); - pp->recoil_horizoff = 0; + pp->recoil_ohorizoff = pp->recoil_horizoff = 0; return; } // move pp->q16horiz up and down + pp->recoil_ohorizoff = pp->recoil_horizoff; pp->recoil_horizoff = pp->recoil_amt * bsin(pp->recoil_ndx, 2); } @@ -7654,6 +7655,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_amt) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_speed) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_ndx) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_horizoff) +DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_ohorizoff) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposx) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposy) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposz) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index b18997f66..a24351886 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -510,6 +510,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P ("recoil_speed", w.recoil_speed) ("recoil_ndx", w.recoil_ndx) ("recoil_horizoff", w.recoil_horizoff) + ("recoil_ohorizoff", w.recoil_ohorizoff) ("oldposx", w.oldposx) ("oldposy", w.oldposy) ("oldposz", w.oldposz)