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
This commit is contained in:
alexey.lysiuk 2018-03-04 15:11:45 +02:00
parent d0ec6ef1d4
commit ac47166894
2 changed files with 5 additions and 1 deletions

View file

@ -2388,7 +2388,9 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
level.info->Snapshot.Clean(); level.info->Snapshot.Clean();
insave = false; insave = false;
I_FreezeTime(false);
if (cl_waitforsave)
I_FreezeTime(false);
} }

View file

@ -187,10 +187,12 @@ void I_FreezeTime(bool frozen)
{ {
if (frozen) if (frozen)
{ {
assert(FreezeTime == 0);
FreezeTime = GetClockTimeNS(); FreezeTime = GetClockTimeNS();
} }
else else
{ {
assert(FreezeTime != 0);
FirstFrameStartTime += GetClockTimeNS() - FreezeTime; FirstFrameStartTime += GetClockTimeNS() - FreezeTime;
FreezeTime = 0; FreezeTime = 0;
I_SetFrameTime(); I_SetFrameTime();