]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Link client slowmo cvar with the QC stat (fixes slowmo not working properly)
authorMario <mario@smbclan.net>
Fri, 26 Feb 2016 10:41:01 +0000 (20:41 +1000)
committerMario <mario@smbclan.net>
Fri, 26 Feb 2016 10:41:01 +0000 (20:41 +1000)
qcsrc/client/main.qc
qcsrc/common/physics/player.qc

index aa490aa505c21e8c38fc46c52f0813da9b266ed8..14279816efdee0f62642a3cfe2fb0fb370fad76b 100644 (file)
@@ -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))
index 0da3c1df375520f02ab2608b824d6f8afaa4bbe6..208b16c3b8f6473acde347790d82cd23d0425619 100644 (file)
@@ -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