]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CA: Floor health and armor in PreventStalemate
authorz411 <z411@omaera.org>
Thu, 28 Nov 2024 03:41:36 +0000 (03:41 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Thu, 28 Nov 2024 03:41:36 +0000 (03:41 +0000)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc

index dcdc11414a3dc9f8e459e4e43201a7a71d891db4..faa8a323cbb5158823d154a0f3a40a5685d137f9 100644 (file)
@@ -104,9 +104,12 @@ int CA_PreventStalemate()
                        {
                                if (IS_DEAD(it))
                                        continue;
-                               teamHealth += GetResource(it, RES_HEALTH) + GetResource(it, RES_ARMOR);
+                               teamHealth += floor(GetResource(it, RES_HEALTH)) + floor(GetResource(it, RES_ARMOR));
                        });
 
+                       // Round the resulting team health just in case
+                       teamHealth = rint(teamHealth);
+
                        // Set the winner teams
                        if(!winnerTeam || teamHealth > winnerTeamHealth)
                        {