]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
properly fix the 0% issue in the strafe% scoreboard entry this time
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 16 Oct 2020 20:52:24 +0000 (22:52 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 16 Oct 2020 20:52:24 +0000 (22:52 +0200)
qcsrc/server/strafe.qc

index 483bb65c8c40cb6fe27c752efd527d320927f688..d3bdb71638038a13d3cf2bb0394487601e8ef3cd 100644 (file)
@@ -4,7 +4,7 @@
 #include <common/physics/player.qh>
 #include <common/stats.qh>
 
-.float race_checkpoint;
+.float race_started;
 
 float calculate_strafe_efficiency(entity strafeplayer, vector movement)
 {
@@ -144,7 +144,8 @@ float calculate_strafe_efficiency(entity strafeplayer, vector movement)
             wishangle = -wishangle;
         }
 
-        if(speed > 0 && !swimming && strafeplayer.race_checkpoint > 0) // only calculate a new average if all conditions are met
+        // note about accuracy: a few ticks after dying do still have race_started set to true causing minimal interference (most likely <0.1%) in the efficiency total
+        if(speed > 0 && !swimming && strafeplayer.race_started) // only calculate the efficiency if all conditions are met
         {
             float efficiency = 0;
             float moveangle = angle + wishangle;