From: Mario Date: Fri, 17 Jul 2020 07:38:42 +0000 (+1000) Subject: Calculate desired speed on the client side, alleviates the need for a networked stat X-Git-Tag: xonotic-v0.8.5~856^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F843%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Calculate desired speed on the client side, alleviates the need for a networked stat --- diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 153ff98d2..9ecac9f7c 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -340,8 +340,6 @@ bool autocvar_g_shootfromeye; REGISTER_STAT(SHOOTFROMEYE, bool, autocvar_g_shootfromeye) REGISTER_STAT(SHOOTFROMCENTER, bool, autocvar_g_shootfromcenter) -REGISTER_STAT(MOVEVARS_SPEED, float) - REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float) REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float) REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float) diff --git a/qcsrc/ecs/systems/cl_physics.qc b/qcsrc/ecs/systems/cl_physics.qc index 4d38c574d..d4718514d 100644 --- a/qcsrc/ecs/systems/cl_physics.qc +++ b/qcsrc/ecs/systems/cl_physics.qc @@ -26,7 +26,7 @@ void sys_phys_spectator_control(entity this) {} void sys_phys_fixspeed(entity this, float maxspeed_mod) { - float spd = STAT(MOVEVARS_SPEED, this); + float spd = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod; if (this.speed != spd) { this.speed = spd; string temps = ftos(spd); diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index 196f6f193..175c57c48 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -84,9 +84,6 @@ 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; - STAT(MOVEVARS_SPEED, this) = spd; - 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));