Exclude reserve teams from cups by default

If you need to define a cup that includes reserve teams, you can add the
include_reserve_teams property to the cup definition.
This commit is contained in:
Tom Stellard 2020-09-21 20:06:43 -07:00
parent 344bc82b53
commit 9d2440be85
1 changed files with 6 additions and 0 deletions

View File

@ -481,6 +481,9 @@ cup_load_choose_team_from_league(Cup *cup, const League *league,
{
Team *team = team_of_id(
g_array_index(table->elements, TableElement, j).team_id);
if (team_is_reserve_team(team) &&
!query_league_cup_has_property(cup->id, "include_reserve_teams"))
continue;
g_ptr_array_add(teams, team);
g_ptr_array_add(cup->team_names, g_strdup(team->name));
}
@ -500,6 +503,9 @@ cup_load_choose_team_from_league(Cup *cup, const League *league,
for(j = 0; j < end; j++)
{
Team *team = team_of_id(g_array_index(table->elements, TableElement, order[j]).team_id);
if (team_is_reserve_team(team) &&
!query_league_cup_has_property(cup->id, "include_reserve_teams"))
continue;
if(debug > 80)
g_print("j %d order %d team %s isinint %d numteams %d\n",
j, order[j],