]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CA: fix scoring bug where players with negative scores have one point more
authorterencehill <piuntn@gmail.com>
Tue, 15 Feb 2022 13:44:52 +0000 (14:44 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 15 Feb 2022 13:44:52 +0000 (14:44 +0100)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc

index 1b8f68e7ea83fe6d8a671cd0097c73b8e0297512..9775619f51c7ccc1a4ef615e576ade91b56b9316 100644 (file)
@@ -411,7 +411,7 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor)
        if (scorer)
        {
                scorer.ca_damage_counter += scorer_damage;
-               if (fabs(scorer.ca_damage_counter) < autocvar_g_ca_damage2score)
+               if (scorer.ca_damage_counter >= 0 && scorer.ca_damage_counter < autocvar_g_ca_damage2score)
                        return;
                // NOTE: here we are actually rounding since ca_damage_counter is
                // initialized on player spawn to half autocvar_g_ca_damage2score