Fixture scheduling bugfix.

This commit is contained in:
gyboth 2008-12-28 10:24:54 +00:00
parent f714fd7f8e
commit 0426ebfd76
5 changed files with 10 additions and 8 deletions

View File

@ -113,8 +113,7 @@ fixture_write_cup_fixtures(Cup *cup)
gint i; gint i;
for(i=0;i<cup->rounds->len;i++) cup_get_team_pointers(cup, 0);
cup_get_team_pointers(cup, i);
if(g_array_index(cup->rounds, CupRound, 0).round_robin_number_of_groups > 0) if(g_array_index(cup->rounds, CupRound, 0).round_robin_number_of_groups > 0)
fixture_write_cup_round_robin( fixture_write_cup_round_robin(
@ -170,6 +169,7 @@ fixture_update(Cup *cup)
} }
new_round = &g_array_index(cup->rounds, CupRound, round + 1); new_round = &g_array_index(cup->rounds, CupRound, round + 1);
cup_get_team_pointers(cup, round + 1);
for(i=0;i<new_round->team_ptrs->len;i++) for(i=0;i<new_round->team_ptrs->len;i++)
g_ptr_array_add(teams, g_ptr_array_index(new_round->team_ptrs, i)); g_ptr_array_add(teams, g_ptr_array_index(new_round->team_ptrs, i));
@ -696,6 +696,7 @@ fixture_write_knockout_round(Cup *cup, gint cup_round, GPtrArray *teams)
week_number = (round->two_match_week) ? week_number = (round->two_match_week) ?
week_number : week_number :
league_cup_get_week_with_break(cup->id, week_number + cup->week_gap); league_cup_get_week_with_break(cup->id, week_number + cup->week_gap);
week_round_number = week_round_number =
fixture_get_free_round(week_number, teams, -1, -1); fixture_get_free_round(week_number, teams, -1, -1);
for(i=0; i<=(teams->len - 2) / 2; i++) for(i=0; i<=(teams->len - 2) / 2; i++)

View File

@ -1128,7 +1128,7 @@ league_cup_adjust_week_breaks(GArray *week_breaks, gint week_gap)
gint i; gint i;
for(i = 0; i < week_breaks->len; i++) for(i = 0; i < week_breaks->len; i++)
if(g_array_index(week_breaks, WeekBreak, i).length == -1) if(g_array_index(week_breaks, WeekBreak, i).length == -1000)
g_array_index(week_breaks, WeekBreak, i).length = week_gap; g_array_index(week_breaks, WeekBreak, i).length = week_gap;
} }

View File

@ -1003,20 +1003,21 @@ treeview_create_fixtures_header(const Fixture *fix, GtkListStore *ls, gboolean b
gchar *name = NULL; gchar *name = NULL;
gchar *symbol = NULL; gchar *symbol = NULL;
sprintf(buf3, _("Week %d Round %d"), fix->week_number, fix->week_round_number);
if(fix->clid < ID_CUP_START) if(fix->clid < ID_CUP_START)
{ {
sprintf(buf3, _("Week %d Round %d"), fix->week_number, fix->week_round_number);
name = league_cup_get_name_string(fix->clid); name = league_cup_get_name_string(fix->clid);
strcpy(round_name, ""); strcpy(round_name, "");
symbol = league_from_clid(fix->clid)->symbol; symbol = league_from_clid(fix->clid)->symbol;
} }
else else
{ {
sprintf(buf3, _("Week %d Round %d\nCup round %d"),
fix->week_number, fix->week_round_number, fix->round + 1);
name = cup_from_clid(fix->clid)->name; name = cup_from_clid(fix->clid)->name;
cup_round_name(fix, buf); cup_round_name(fix, buf);
sprintf(round_name, "\n%s", buf); sprintf(round_name, "\n%s", buf);
strcat(buf3, "\n");
symbol = cup_from_clid(fix->clid)->symbol; symbol = cup_from_clid(fix->clid)->symbol;
} }

View File

@ -175,7 +175,7 @@ xml_cup_read_start_element (GMarkupParseContext *context,
if(attribute_names[0] != NULL && strcmp(attribute_names[0], ATT_DEF_NAME_WEEK_BREAK_LENGTH) == 0) if(attribute_names[0] != NULL && strcmp(attribute_names[0], ATT_DEF_NAME_WEEK_BREAK_LENGTH) == 0)
new_week_break.length = (gint)g_ascii_strtod(attribute_values[0], NULL); new_week_break.length = (gint)g_ascii_strtod(attribute_values[0], NULL);
else else
new_week_break.length = -1; new_week_break.length = -1000;
} }
else if(strcmp(element_name, TAG_DEF_YELLOW_RED) == 0) else if(strcmp(element_name, TAG_DEF_YELLOW_RED) == 0)
state = STATE_YELLOW_RED; state = STATE_YELLOW_RED;