]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc
Merge branch 'master' into Mario/weaponorder
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / invasion / sv_invasion.qc
index c9670a150c38d1dac71880355f6ce712b964b5e3..31c5711424834925e91cb53e21d64da6ea2e9e39 100644 (file)
@@ -288,7 +288,7 @@ bool Invasion_CheckWinner()
 
        float total_alive_monsters = 0, supermonster_count = 0, red_alive = 0, blue_alive = 0, yellow_alive = 0, pink_alive = 0;
 
-       IL_EACH(g_monsters, GetResourceAmount(it, RESOURCE_HEALTH) > 0,
+       IL_EACH(g_monsters, GetResource(it, RES_HEALTH) > 0,
        {
                if((get_monsterinfo(it.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
                        ++supermonster_count;
@@ -334,14 +334,20 @@ bool Invasion_CheckWinner()
        {
                if(red_alive > 0) { winner_team = NUM_TEAM_1; }
                if(blue_alive > 0)
-               if(winner_team) { winner_team = 0; }
-               else { winner_team = NUM_TEAM_2; }
+               {
+                       if(winner_team) { winner_team = 0; }
+                       else { winner_team = NUM_TEAM_2; }
+               }
                if(yellow_alive > 0)
-               if(winner_team) { winner_team = 0; }
-               else { winner_team = NUM_TEAM_3; }
+               {
+                       if(winner_team) { winner_team = 0; }
+                       else { winner_team = NUM_TEAM_3; }
+               }
                if(pink_alive > 0)
-               if(winner_team) { winner_team = 0; }
-               else { winner_team = NUM_TEAM_4; }
+               {
+                       if(winner_team) { winner_team = 0; }
+                       else { winner_team = NUM_TEAM_4; }
+               }
        }
        else
        {
@@ -429,13 +435,15 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
                if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; }
 
                if(IS_PLAYER(frag_attacker))
-               if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
-                       GameRules_scoring_add(frag_attacker, KILLS, -1);
-               else
                {
-                       GameRules_scoring_add(frag_attacker, KILLS, +1);
-                       if(teamplay)
-                               TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
+                       if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
+                               GameRules_scoring_add(frag_attacker, KILLS, -1);
+                       else
+                       {
+                               GameRules_scoring_add(frag_attacker, KILLS, +1);
+                               if(teamplay)
+                                       TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
+                       }
                }
        }
 }