mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-03-18 03:30:08 +01:00
Load save bugfix.
This commit is contained in:
parent
ab80dc1917
commit
5e2c67c570
@ -184,6 +184,8 @@ start_new_season(void)
|
||||
(pointers might have changed because of prom/rel). */
|
||||
else if(cp(i).add_week == -1)
|
||||
fixture_refresh_team_pointers(cp(i).fixtures);
|
||||
else if(!query_cup_self_referential(&cp(i)))
|
||||
cup_reset(&cp(i));
|
||||
}
|
||||
|
||||
for(i = acps->len - 1; i >= 0; i--)
|
||||
|
10
src/team.c
10
src/team.c
@ -233,8 +233,7 @@ team_of_id(gint id)
|
||||
printf("team_of_id\n");
|
||||
#endif
|
||||
|
||||
|
||||
gint i, j;
|
||||
gint i, j, k;
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
for(j=0;j<lig(i).teams->len;j++)
|
||||
@ -242,9 +241,10 @@ team_of_id(gint id)
|
||||
return &g_array_index(lig(i).teams, Team, j);
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
for(j=0;j<cp(i).teams->len;j++)
|
||||
if(((Team*)g_ptr_array_index(cp(i).teams, j))->id == id)
|
||||
return (Team*)g_ptr_array_index(cp(i).teams, j);
|
||||
for(j = 0; j < cp(i).rounds->len; j++)
|
||||
for(k = 0; k < g_array_index(cp(i).rounds, CupRound, j).teams->len; k++)
|
||||
if(g_array_index(g_array_index(cp(i).rounds, CupRound, j).teams, Team, k).id == id)
|
||||
return &g_array_index(g_array_index(cp(i).rounds, CupRound, j).teams, Team, k);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND,
|
||||
"team_of_id: team with id %d not found.", id);
|
||||
|
@ -261,13 +261,10 @@ xml_loadsave_fixtures_write(const gchar *filename, const GArray *fixtures)
|
||||
TAG_FIXTURE_RESULT, I1);
|
||||
xml_write_int(fil, g_array_index(fixtures, Fixture, i).result[j][2],
|
||||
TAG_FIXTURE_RESULT, I1);
|
||||
xml_write_int(fil, g_array_index(fixtures, Fixture, i).team_ids[j],
|
||||
TAG_TEAM_ID, I1);
|
||||
}
|
||||
|
||||
xml_write_int(fil, g_array_index(fixtures, Fixture, i).team_ids[0],
|
||||
TAG_TEAM_ID, I1);
|
||||
xml_write_int(fil, g_array_index(fixtures, Fixture, i).team_ids[1],
|
||||
TAG_TEAM_ID, I1);
|
||||
|
||||
fprintf(fil, "</_%d>\n", TAG_FIXTURE);
|
||||
}
|
||||
fprintf(fil, "</_%d>\n", TAG_FIXTURES);
|
||||
|
Loading…
x
Reference in New Issue
Block a user