From 5bb7c7a647865aa93dce55bee1f1276e48571b42 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 24 Jul 2020 19:38:09 +1000 Subject: [PATCH] - adjust `elapsedInputTicks` in `GetInput()` to be `1000.0 / REALGAMETICSPERSEC`. * 1000 / 30 = 33.333~. This ensures that if 33.333 is the minimum value, the calculation for scaleAdjust always equals 1.0 (no scaling). --- source/games/duke/src/input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index bcee8f4cd..8f2b4aa8b 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -1207,7 +1207,7 @@ void GetInput() auto now = I_msTimeF(); // do not let this become too large - it would create overflows resulting in undefined behavior. The very first tic must not use the timer difference at all because the timer has not been set yet. // This really needs to have the timer fixed to be robust, doing it ad-hoc here is not really safe. - if (lastCheck > 0) elapsedInputTicks = min(now - lastCheck, (double)(REALGAMETICSPERSEC)); + if (lastCheck > 0) elapsedInputTicks = min(now - lastCheck, 1000.0 / REALGAMETICSPERSEC); else elapsedInputTicks = 1; lastCheck = now;