From ac47166894a9eb7d6281eb9d067c2fd0891b8c31 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 4 Mar 2018 15:11:45 +0200 Subject: [PATCH] Fixed freeze after saving game when cl_waitforsave CVAR set to false Restored assertions that help to spot incorrect usage of I_FreezeTime() function https://forum.zdoom.org/viewtopic.php?t=59672 --- src/g_game.cpp | 4 +++- src/i_time.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index d0cf74be7..2ca349631 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2388,7 +2388,9 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio level.info->Snapshot.Clean(); insave = false; - I_FreezeTime(false); + + if (cl_waitforsave) + I_FreezeTime(false); } diff --git a/src/i_time.cpp b/src/i_time.cpp index 29119ddb4..8fd058723 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -187,10 +187,12 @@ void I_FreezeTime(bool frozen) { if (frozen) { + assert(FreezeTime == 0); FreezeTime = GetClockTimeNS(); } else { + assert(FreezeTime != 0); FirstFrameStartTime += GetClockTimeNS() - FreezeTime; FreezeTime = 0; I_SetFrameTime();