]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Calculate desired speed on the client side, alleviates the need for a networked stat
authorMario <mario.mario@y7mail.com>
Fri, 17 Jul 2020 07:38:42 +0000 (17:38 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 17 Jul 2020 07:38:42 +0000 (17:38 +1000)
qcsrc/common/stats.qh
qcsrc/ecs/systems/cl_physics.qc
qcsrc/ecs/systems/sv_physics.qc

index 153ff98d2203ba3051b357c6174ca50b2695071b..9ecac9f7c0bdd0bf2ee59dad460c6beea9905fc0 100644 (file)
@@ -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)
index 4d38c574d9cdac5345bdf9782989aed40b694f7d..d4718514d232770721dc8d215b87e35dd51b8f0a 100644 (file)
@@ -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);
index 196f6f193cf539598cadd7662cb8af8b269a1a8c..175c57c4844de5206959de1031ad4adff23577fa 100644 (file)
@@ -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));