diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index dd9c61efb..57e4f3465 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5951,7 +5951,7 @@ MAIN_LOOP_RESTART: ototalclock += TICSPERFRAME; - int const moveClock = (int)totalclock; + auto const moveClock = totalclock; if (((!GUICapture && (myplayer.gm & MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) && (myplayer.gm & MODE_GAME)) @@ -5960,14 +5960,12 @@ MAIN_LOOP_RESTART: G_DoMoveThings(); } - if (totalclock - moveClock >= (TICSPERFRAME>>1)) - { - // computing a tic takes longer than half a tic, so we're slowing - // the game down. rather than tightly spinning here, go draw - // a frame since we're fucked anyway + // computing a tic is taking too long. + // rather than tightly spinning here, go draw a frame since we're fucked anyway + if ((int)(totalclock - moveClock) >= (TICSPERFRAME >> 1)) break; - } - } while (((g_netClient || g_netServer) || (myplayer.gm & (MODE_MENU | MODE_DEMO)) == 0) && totalclock >= ototalclock + TICSPERFRAME); + } + while (((g_netClient || g_netServer) || (myplayer.gm & (MODE_MENU | MODE_DEMO)) == 0) && (int)(totalclock - ototalclock) >= TICSPERFRAME); gameUpdate = true; g_gameUpdateTime = timerGetHiTicks() - gameUpdateStartTime;