Joined league scheduling fix.

This commit is contained in:
gyboth 2009-01-25 14:01:44 +00:00
parent 2eafaebc4b
commit 8a684b2f1d
2 changed files with 10 additions and 4 deletions

View File

@ -55,9 +55,6 @@ fixture_write_league_fixtures(League *league)
max_rr = league->round_robins;
teams = team_get_pointers_from_array(league->teams, NULL);
g_array_free(league->fixtures, TRUE);
league->fixtures = g_array_new(FALSE, FALSE, sizeof(Fixture));
/** Add all teams to the same pointer array. */
for(i = 0; i < league->joined_leagues->len; i++)
{

View File

@ -169,6 +169,15 @@ start_new_season(void)
start_new_season_reset_ids();
}
/* We have to reset all fixture arrays beforehand because
of interleague scheduling (see joined_league). */
for(i=0;i<ligs->len;i++)
if(query_league_active(&lig(i)))
{
g_array_free(lig(i).fixtures, TRUE);
lig(i).fixtures = g_array_new(FALSE, FALSE, sizeof(Fixture));
}
for(i=0;i<ligs->len;i++)
if(query_league_active(&lig(i)))
fixture_write_league_fixtures(&lig(i));