mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- fixed: prevent i_timescale from freezing the game if set to too low a value
This commit is contained in:
parent
12a44f5bc9
commit
6c4f6f94f4
1 changed files with 6 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue