From 6c4f6f94f436bb0555312805844217f1abc9aebb Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 29 Nov 2017 08:41:09 -0500 Subject: [PATCH] - fixed: prevent i_timescale from freezing the game if set to too low a value --- src/i_time.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/i_time.cpp b/src/i_time.cpp index ce394fb678..0511a79f06 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -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()