From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 16 Oct 2020 20:52:24 +0000 (+0200) Subject: properly fix the 0% issue in the strafe% scoreboard entry this time X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5457b26e4bcf8f91902286d52174bad5a7250d18;p=xonotic%2Fxonotic-data.pk3dir.git properly fix the 0% issue in the strafe% scoreboard entry this time --- diff --git a/qcsrc/server/strafe.qc b/qcsrc/server/strafe.qc index 483bb65c8..d3bdb7163 100644 --- a/qcsrc/server/strafe.qc +++ b/qcsrc/server/strafe.qc @@ -4,7 +4,7 @@ #include #include -.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;