From: Mario Date: Fri, 26 Feb 2016 10:41:01 +0000 (+1000) Subject: Link client slowmo cvar with the QC stat (fixes slowmo not working properly) X-Git-Tag: xonotic-v0.8.2~1177 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a7b2204090b78670c19e33f1db5b5ab60d91b16;p=xonotic%2Fxonotic-data.pk3dir.git Link client slowmo cvar with the QC stat (fixes slowmo not working properly) --- 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