From: Mario Date: Mon, 1 Mar 2021 13:14:33 +0000 (+1000) Subject: Move setting of client-side player movement speed settings back to the server, fixes... X-Git-Tag: xonotic-v0.8.5~549 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7140a65f022080721222d002db3348c9aac9306b;p=xonotic%2Fxonotic-data.pk3dir.git Move setting of client-side player movement speed settings back to the server, fixes #2531 --- diff --git a/qcsrc/ecs/systems/cl_physics.qc b/qcsrc/ecs/systems/cl_physics.qc index d4718514d..624e0a912 100644 --- a/qcsrc/ecs/systems/cl_physics.qc +++ b/qcsrc/ecs/systems/cl_physics.qc @@ -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) {} diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index 0d50baac5..d0ce80c5b 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -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));