mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +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