X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores_rules.qc;h=39dbd49a35ddc630c85c849624330e1785d30d01;hb=5d36c4af90925223244be05529c0152f5011e7ce;hp=64c94001fbc5bcd9ab42caffd6d8c86604368a32;hpb=c3f4bfe02b1f024b183210717a4da3f84ddc0079;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 64c94001f..39dbd49a3 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -9,8 +9,6 @@ int ScoreRules_teams; -void CheckAllowedTeams (entity for_whom); - int NumTeams(int teams) { return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3)); @@ -19,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 @@ -66,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, {}); }