From d30bf548bdcc42311fc3b1b4ee4ff1408fd6d771 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 11 May 2020 22:14:09 +1000 Subject: [PATCH] Duke3D: Restore old interpolations when camera is chasing actor who whacked you (idea from NY00123). --- source/duke3d/src/game.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 334306b54..22cb27ea5 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -726,9 +726,21 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) pPlayer->opos.y + mulscale16(pPlayer->pos.y - pPlayer->opos.y, smoothRatio), pPlayer->opos.z + mulscale16(pPlayer->pos.z - pPlayer->opos.z, smoothRatio) }; - CAMERA(pos) = camVect; - CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang); - CAMERA(q16horiz) = pPlayer->q16horiz + pPlayer->q16horizoff; + CAMERA(pos) = camVect; + + if (pPlayer->wackedbyactor >= 0) + { + CAMERA(q16ang) = pPlayer->oq16ang + + mulscale16(((pPlayer->q16ang + F16(1024) - pPlayer->oq16ang) & 0x7FFFFFF) - F16(1024), smoothRatio) + + fix16_from_int(pPlayer->look_ang); + CAMERA(q16horiz) = pPlayer->oq16horiz + pPlayer->oq16horizoff + + mulscale16((pPlayer->q16horiz + pPlayer->q16horizoff - pPlayer->oq16horiz - pPlayer->oq16horizoff), smoothRatio); + } + else + { + CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang); + CAMERA(q16horiz) = pPlayer->q16horiz + pPlayer->q16horizoff; + } if (cl_viewbob) {