diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 9bd27b29e..7fae461f3 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -95,7 +95,7 @@ GameInterface* gi; int myconnectindex, numplayers; int connecthead, connectpoint2[MAXMULTIPLAYERS]; auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries. -int gameclock; +int gameclock, gameclockstart; int lastTic; int automapMode; diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index 9f1a173b0..8c10e090d 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -219,4 +219,5 @@ extern int automapMode; extern bool automapFollow; extern bool sendPause; extern int gameclock; +extern int gameclockstart; extern int lastTic; diff --git a/source/games/duke/src/gameloop.cpp b/source/games/duke/src/gameloop.cpp index 0178cefc2..14c1c70ca 100644 --- a/source/games/duke/src/gameloop.cpp +++ b/source/games/duke/src/gameloop.cpp @@ -294,7 +294,7 @@ void GameTicker() gameupdatetime.Clock(); int const currentTic = I_GetTime(); - gameclock = I_GetBuildTime(); + gameclock = I_GetBuildTime() - gameclockstart; while (playrunning() && currentTic - lastTic >= 1) { @@ -361,8 +361,8 @@ void startmainmenu() void resetGameClock() { - I_ResetTime(); - lastTic = -1; + I_SetFrameTime(); + gameclockstart = I_GetTime(); gameclock = 0; cloudclock = 0; }