X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores_rules.qc;h=39dbd49a35ddc630c85c849624330e1785d30d01;hb=6e44347e3ec9f9df3882325707e966e9fd9b7f42;hp=160b5df5e4cfb21c279b96c39d28dbe6965b27d4;hpb=5aab6120acfc624751d20a695d1b911b3e919831;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 160b5df5e..39dbd49a3 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -17,8 +17,6 @@ int NumTeams(int teams) int AvailableTeams() { return NumTeams(ScoreRules_teams); - // NOTE: this method is unreliable, as forced teams set the c* globals to weird values - //return boolean(c1 >= 0) + boolean(c2 >= 0) + boolean(c3 >= 0) + boolean(c4 >= 0); } // NOTE: ST_constants may not be >= MAX_TEAMSCORE @@ -64,12 +62,11 @@ void ScoreRules_basics_end() void ScoreRules_generic() { int teams = 0; - if (teamplay) { - CheckAllowedTeams(NULL); - if (c1 >= 0) teams |= BIT(0); - if (c2 >= 0) teams |= BIT(1); - if (c3 >= 0) teams |= BIT(2); - if (c4 >= 0) teams |= BIT(3); + if (teamplay) + { + entity balance = TeamBalance_CheckAllowedTeams(NULL); + teams = TeamBalance_GetAllowedTeams(balance); + TeamBalance_Destroy(balance); } GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {}); }