]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move setting of client-side player movement speed settings back to the server, fixes...
authorMario <mario.mario@y7mail.com>
Mon, 1 Mar 2021 13:14:33 +0000 (23:14 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 1 Mar 2021 13:14:49 +0000 (23:14 +1000)
qcsrc/ecs/systems/cl_physics.qc
qcsrc/ecs/systems/sv_physics.qc

index d4718514d232770721dc8d215b87e35dd51b8f0a..624e0a9126e8a497272cf0ad2a9c98ec6b26b2eb 100644 (file)
@@ -24,15 +24,4 @@ void sys_phys_pregame_hold(entity this) {}
 
 void sys_phys_spectator_control(entity this) {}
 
-void sys_phys_fixspeed(entity this, float maxspeed_mod)
-{
-       float spd = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod;
-       if (this.speed != spd) {
-               this.speed = spd;
-               string temps = ftos(spd);
-               cvar_set("cl_forwardspeed", temps);
-               cvar_set("cl_backspeed", temps);
-               cvar_set("cl_sidespeed", temps);
-               cvar_set("cl_upspeed", temps);
-       }
-}
+void sys_phys_fixspeed(entity this, float maxspeed_mod) {}
index 0d50baac5797d2810cea19ef2a3f77b382b7a982..d0ce80c5bc588a625f7b41bedbfefd7891e382fa 100644 (file)
@@ -88,6 +88,16 @@ void sys_phys_spectator_control(entity this)
 
 void sys_phys_fixspeed(entity this, float maxspeed_mod)
 {
+       float spd = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod;
+       if (this.speed != spd) {
+               this.speed = spd; // TODO: send this as a stat and set the below cvars on the client?
+               string temps = ftos(spd);
+               stuffcmd(this, strcat("cl_forwardspeed ", temps, "\n"));
+               stuffcmd(this, strcat("cl_backspeed ", temps, "\n"));
+               stuffcmd(this, strcat("cl_sidespeed ", temps, "\n"));
+               stuffcmd(this, strcat("cl_upspeed ", temps, "\n"));
+       }
+
        if (this.jumpspeedcap_min != autocvar_sv_jumpspeedcap_min) {
                this.jumpspeedcap_min = autocvar_sv_jumpspeedcap_min;
                stuffcmd(this, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));