From e4af4f28ced3d556dbcfe058e5535a4cd4befec4 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 15 Oct 2020 10:27:08 +1100 Subject: [PATCH] - Duke (RR): Avoid integer truncation when dividing `p->VBumpNow`. --- source/games/duke/src/player_r.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index b7bde4b45..210fdcea0 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1718,7 +1718,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) } } - int horiz = 0; + double horiz = 0; if (p->TurbCount) { if (p->TurbCount <= 1) @@ -1743,7 +1743,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) p->VBumpNow++; if (p->VBumpTarget < p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3; + horiz = p->VBumpNow / 3.; } else if (p->VBumpTarget < p->VBumpNow) { @@ -1753,7 +1753,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) p->VBumpNow--; if (p->VBumpTarget > p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3; + horiz = p->VBumpNow / 3.; } else { @@ -2047,7 +2047,7 @@ static void onBoat(int snum, ESyncBits &actions) } } - int horiz = 0; + double horiz = 0; if (p->TurbCount) { if (p->TurbCount <= 1) @@ -2072,7 +2072,7 @@ static void onBoat(int snum, ESyncBits &actions) p->VBumpNow++; if (p->VBumpTarget < p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3; + horiz = p->VBumpNow / 3.; } else if (p->VBumpTarget < p->VBumpNow) { @@ -2082,7 +2082,7 @@ static void onBoat(int snum, ESyncBits &actions) p->VBumpNow--; if (p->VBumpTarget > p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3; + horiz = p->VBumpNow / 3.; } else {