]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_invasion.qc
improve descriptions, add missing cvar to config
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_invasion.qc
index 9dcf1d314e3023b562574e29047c345b0ca5b0f0..1b8b77ae078158e566fb34a87c754701436175d3 100644 (file)
@@ -346,7 +346,7 @@ bool Invasion_CheckWinner()
        else
        {
                FOREACH_CLIENT(IS_PLAYER(it), {
-                       float cs = PlayerScore_Add(it, SP_KILLS, 0);
+                       float cs = GameRules_scoring_add(it, KILLS, 0);
                        if(cs > winning_score)
                        {
                                winning_score = cs;
@@ -430,10 +430,10 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
 
                if(IS_PLAYER(frag_attacker))
                if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
-                       PlayerScore_Add(frag_attacker, SP_KILLS, -1);
+                       GameRules_scoring_add(frag_attacker, KILLS, -1);
                else
                {
-                       PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+                       GameRules_scoring_add(frag_attacker, KILLS, +1);
                        if(teamplay)
                                TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
                }
@@ -576,14 +576,7 @@ void invasion_DelayedInit(entity this) // Do this check with a delay so we can w
 
        if(autocvar_g_invasion_teams)
        {
-               invasion_teams = bound(2, autocvar_g_invasion_teams, 4);
-               int teams = 0;
-               if(invasion_teams >= 1) teams |= BIT(0);
-               if(invasion_teams >= 2) teams |= BIT(1);
-               if(invasion_teams >= 3) teams |= BIT(2);
-               if(invasion_teams >= 4) teams |= BIT(3);
-
-               invasion_teams = teams; // now set it?
+               invasion_teams = BITS(bound(2, autocvar_g_invasion_teams, 4));
        }
        else
                invasion_teams = 0;