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: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=b02c48825fcd881c01d1283798ccc409c2086729 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 153ff98d22..9ecac9f7c0 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 4d38c574d9..d4718514d2 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 196f6f193c..175c57c484 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));