From 1a7b2204090b78670c19e33f1db5b5ab60d91b16 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 26 Feb 2016 20:41:01 +1000 Subject: [PATCH] Link client slowmo cvar with the QC stat (fixes slowmo not working properly) --- qcsrc/client/main.qc | 2 ++ qcsrc/common/physics/player.qc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index aa490aa50..14279816e 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -202,6 +202,8 @@ void Shutdown() if(autocvar_chase_active < 0) cvar_set("chase_active", "0"); + cvar_set("slowmo", cvar_defstring("slowmo")); // reset it back to 'default' + if (!isdemo()) { if (!(calledhooks & HOOK_START)) diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 0da3c1df3..208b16c3b 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -1283,6 +1283,10 @@ bool IsFlying(entity this) return true; } +#ifdef CSQC +float autocvar_slowmo; +#endif + void PM_Main(entity this) { int buttons = PHYS_INPUT_BUTTON_MASK(this); @@ -1321,6 +1325,9 @@ void PM_Main(entity this) if (this.PlayerPhysplug) if (this.PlayerPhysplug()) return; +#elif defined(CSQC) + if(autocvar_slowmo != STAT(MOVEVARS_TIMESCALE)) + cvar_set("slowmo", ftos(STAT(MOVEVARS_TIMESCALE))); #endif #ifdef SVQC -- 2.39.2