From 46810ec490f336fea4de7dfe840daa9512b429a6 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 22 Sep 2020 15:51:48 +1000 Subject: [PATCH] - fix a few places where Q16.16 values were downscaled, only to be scaled back up again. --- source/blood/src/player.cpp | 2 +- source/blood/src/prediction.cpp | 2 +- source/exhumed/src/gun.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 4c46c0ffa..5ae6c8325 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -1586,7 +1586,7 @@ void ProcessInput(PLAYER *pPlayer) if (klabs(pPlayer->q16slopehoriz) < 4) pPlayer->q16slopehoriz = 0; } - pPlayer->slope = -(FixedToInt(pPlayer->q16horiz) - 100)<<7; + pPlayer->slope = -(pPlayer->q16horiz - IntToFixed(100)) >> 9; if (pInput->actions & SB_INVPREV) { pInput->actions&= ~SB_INVPREV; diff --git a/source/blood/src/prediction.cpp b/source/blood/src/prediction.cpp index 6908981c7..a3925808b 100644 --- a/source/blood/src/prediction.cpp +++ b/source/blood/src/prediction.cpp @@ -263,7 +263,7 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput) if (klabs(predict.at28) < 4) predict.at28 = 0; } - predict.at2c = (-FixedToInt(predict.at24))<<7; + predict.at2c = -(predict.at24 - IntToFixed(100)) >> 9; } void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput) diff --git a/source/exhumed/src/gun.cpp b/source/exhumed/src/gun.cpp index 52550f7ad..c6afa4fb8 100644 --- a/source/exhumed/src/gun.cpp +++ b/source/exhumed/src/gun.cpp @@ -739,7 +739,7 @@ loc_flag: // loc_27266: case kWeaponSword: { - nHeight += (100 - FixedToInt(PlayerList[nLocalPlayer].q16horiz)) << 6; + nHeight += (IntToFixed(100) - PlayerList[nLocalPlayer].q16horiz) >> 10; theZ += nHeight; @@ -844,7 +844,7 @@ loc_flag: } case kWeaponPistol: { - int var_50 = (FixedToInt(PlayerList[nLocalPlayer].q16horiz) - 100) << 2; + int var_50 = (PlayerList[nLocalPlayer].q16horiz - IntToFixed(100)) >> 14; nHeight -= var_50; if (sPlayerInput[nPlayer].nTarget >= 0 && cl_autoaim)