From a250f69a20e53e291c3a58a7167edb5071095d09 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 15 Mar 2018 07:53:02 +0000 Subject: [PATCH] Fix horizoff with q16. This solve the problem with horiz returning to center after standing on a sloped floor. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6767 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 83cc178e2..4fe9a3ad8 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -4624,9 +4624,15 @@ void P_ProcessInput(int playerNum) } if (pPlayer->q16horizoff > 0) + { pPlayer->q16horizoff -= ((pPlayer->q16horizoff >> 3) + fix16_one); + pPlayer->q16horizoff = max(pPlayer->q16horizoff, 0); + } else if (pPlayer->q16horizoff < 0) + { pPlayer->q16horizoff += (((-pPlayer->q16horizoff) >> 3) + fix16_one); + pPlayer->q16horizoff = min(pPlayer->q16horizoff, 0); + } if (highZhit >= 0 && (highZhit&49152) == 49152) {