From b1536d8a0b06c452551f16f24b7139533a52aee5 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 15 Oct 2020 20:33:28 +1100 Subject: [PATCH] - Duke (RRRA): Fix potential issue originating from 1bc51a7367e5bec8b0bf67aaba1e1e3a415a4f2d where horizon might have needed adjustment to 0 but wouldn't have done so. * Previously used to determine whether to apply a horizon adjustment on whether local variable `horiz` was 0 or not (since baseline horizon was 100). * For no particular reason, initalise `horiz` as FRACUNIT and process if it is not equal to one. --- source/games/duke/src/player_r.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 7d0d4fc00..e83b00018 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1714,7 +1714,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) } } - double horiz = 0; + double horiz = FRACUNIT; if (p->TurbCount) { if (p->TurbCount <= 1) @@ -1756,7 +1756,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) p->VBumpTarget = 0; p->moto_bump_fast = 0; } - if (horiz != 0) + if (horiz != FRACUNIT) { p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16())); } @@ -2043,7 +2043,7 @@ static void onBoat(int snum, ESyncBits &actions) } } - double horiz = 0; + double horiz = FRACUNIT; if (p->TurbCount) { if (p->TurbCount <= 1) @@ -2085,7 +2085,7 @@ static void onBoat(int snum, ESyncBits &actions) p->VBumpTarget = 0; p->moto_bump_fast = 0; } - if (horiz != 0) + if (horiz != FRACUNIT) { p->horizon.addadjustment(horiz - FixedToFloat(p->horizon.horiz.asq16())); }