Support the optional and alternative tags for user's league in cup defs

This commit is contained in:
Tom Stellard 2021-07-23 19:52:46 -07:00 committed by Tom Stellard
parent e95c6aac96
commit b2b3d55f58
1 changed files with 6 additions and 1 deletions

View File

@ -544,11 +544,16 @@ cup_load_choose_team_from_league(Cup *cup, const League *league,
}
if(ct->number_of_teams != -1 &&
number_of_teams != ct->number_of_teams)
number_of_teams != ct->number_of_teams) {
if (ct->next)
return cup_load_choose_team(cup, teams, ct->next);
if (ct->optional)
return;
main_exit_program(EXIT_CHOOSE_TEAM_ERROR,
"cup_load_choose_team_from_league (1): not enough teams (that don't participate in international cups yet) found in chooseteam %s for cup %s (%d specified, %d found) cup group %d.\n ",
ct->sid, cup->name, ct->number_of_teams,
number_of_teams, cup->group);
}
}
/** This function is used when a CupChooseTeam object references a cup