1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2024-12-17 02:39:14 +01:00

Fixture scheduling bugfix.

This commit is contained in:
gyboth 2008-12-28 10:24:54 +00:00
parent 6df8bb6e7c
commit 7324c289cc
5 changed files with 10 additions and 8 deletions

View File

@ -609,7 +609,7 @@ cup_load_choose_team_generate(Cup *cup, CupRound *cup_round, const CupChooseTeam
if(number_of_teams == ct->number_of_teams)
break;
}
if(((ct->number_of_teams != -1 && number_of_teams != ct->number_of_teams) ||
(ct->number_of_teams == -1 && number_of_teams != teams_local->len)) &&
teams_local->len > 0)

View File

@ -113,8 +113,7 @@ fixture_write_cup_fixtures(Cup *cup)
gint i;
for(i=0;i<cup->rounds->len;i++)
cup_get_team_pointers(cup, i);
cup_get_team_pointers(cup, 0);
if(g_array_index(cup->rounds, CupRound, 0).round_robin_number_of_groups > 0)
fixture_write_cup_round_robin(
@ -170,6 +169,7 @@ fixture_update(Cup *cup)
}
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++)
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 :
league_cup_get_week_with_break(cup->id, week_number + cup->week_gap);
week_round_number =
fixture_get_free_round(week_number, teams, -1, -1);
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;
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;
}
@ -1145,7 +1145,7 @@ league_cup_get_week_with_break(gint clid, gint week_number)
for(i = 0; i < week_breaks->len; i++)
if(g_array_index(week_breaks, WeekBreak, i).week_number == week_number)
return week_number + g_array_index(week_breaks, WeekBreak, i).length;
return week_number + g_array_index(week_breaks, WeekBreak, i).length;
return week_number;
}

View File

@ -1003,20 +1003,21 @@ treeview_create_fixtures_header(const Fixture *fix, GtkListStore *ls, gboolean b
gchar *name = NULL;
gchar *symbol = NULL;
sprintf(buf3, _("Week %d Round %d"), fix->week_number, fix->week_round_number);
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);
strcpy(round_name, "");
symbol = league_from_clid(fix->clid)->symbol;
}
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;
cup_round_name(fix, buf);
sprintf(round_name, "\n%s", buf);
strcat(buf3, "\n");
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)
new_week_break.length = (gint)g_ascii_strtod(attribute_values[0], NULL);
else
new_week_break.length = -1;
new_week_break.length = -1000;
}
else if(strcmp(element_name, TAG_DEF_YELLOW_RED) == 0)
state = STATE_YELLOW_RED;