- fixed: prevent i_timescale from freezing the game if set to too low a value

This commit is contained in:
Rachael Alexanderson 2017-11-29 08:41:09 -05:00
parent 12a44f5bc9
commit 6c4f6f94f4
1 changed files with 6 additions and 5 deletions

View File

@ -55,20 +55,21 @@ static double TimeScale = 1.0;
CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
{
if (netgame && self != 1.0f)
if (netgame)
{
Printf("Time scale cannot be changed in net games.\n");
self = 1.0f;
}
else
else if (self >= 0.05f)
{
I_FreezeTime(true);
float clampValue = (self < 0.05) ? 0.05f : self;
if (self != clampValue)
self = clampValue;
TimeScale = self;
I_FreezeTime(false);
}
else
{
Printf("Time scale must be at least 0.05!\n");
}
}
static uint64_t GetClockTimeNS()