]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
after renaming health in stack memory so it does't overlap with .health entity field...
authordrjaska <drjaska83@gmail.com>
Mon, 19 Sep 2022 23:30:28 +0000 (02:30 +0300)
committerdrjaska <drjaska83@gmail.com>
Mon, 19 Sep 2022 23:30:28 +0000 (02:30 +0300)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh

index a370897979fb99f2503dfe2595765480ff4181ba..e8e9fb63e9a480b7aa032993dc66e366c5386030 100644 (file)
@@ -112,19 +112,18 @@ print("checking health\n");
                if (IS_DEAD(it)){
                        continue;
                }
-               float health = GetResource(it, RES_HEALTH);
-               float armor = GetResource(it, RES_ARMOR);
+               float healthValue = GetResource(it, RES_HEALTH);
+               float armorValue = GetResource(it, RES_ARMOR);
 
                for (int i = 1; i <= AvailableTeams(); i++)
                        if (it.team == Team_IndexToTeam(i))
-                               (Team_GetTeamFromIndex(i)).health += health+armor;
+                               (Team_GetTeamFromIndex(i)).health += healthValue+armorValue;
        });
 
 print("amount of health in teams\n");
-       // this could be removed with the side-effect that teams will have initially 1 health per survivor
-       //for (int i = 1; i <= AvailableTeams(); i++){
-       //      print(sprintf("%f", Team_GetTeamFromIndex(i).health), "\n");
-       //}
+       for (int i = 1; i <= AvailableTeams(); i++){
+               print(sprintf("%f", Team_GetTeamFromIndex(i).health), "\n");
+       }
 
        highestHealthTeam = 0;
        secondHighestHealthTeam = 0;
index c7e147a21a95d6d4c7c54f321b605600aa693034..fc2513e1c6e0e86d4d89573aff9789fd08c0045a 100644 (file)
@@ -14,6 +14,7 @@ int autocvar_g_ca_teams_override;
 float autocvar_g_ca_warmup;
 string autocvar_g_ca_weaponarena = "most";
 
+.float health;
 
 int ca_teams;
 bool allowed_to_spawn;