From 638553914458d9d5414f4a54614f3849ff35a978 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 16 Oct 2020 10:31:11 +1100 Subject: [PATCH] - Port over `i_timescale` CVAR from GZDoom for use with debugging. * Had situations where this would have been useful instead of manipulating GameTicRate and rebuilding. --- source/core/cheats.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index be05af107..a27a4fa3b 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -457,3 +457,28 @@ CCMD(restartmap) } ChangeLevel(currentLevel, -1); } + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL) +{ + if (netgame) + { + Printf("Time scale cannot be changed in net games.\n"); + self = 1.0f; + } + else if (self >= 0.05f) + { + I_FreezeTime(true); + TimeScale = self; + I_FreezeTime(false); + } + else + { + Printf("Time scale must be at least 0.05!\n"); + } +}