From 3a5ef59134eae90b3b1dcf2d9c1e9c1a20d07649 Mon Sep 17 00:00:00 2001 From: gyboth Date: Tue, 25 Nov 2008 10:09:58 +0000 Subject: [PATCH] Joined league bugfix. --- src/team.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/team.c b/src/team.c index 897bd0a6..497624f7 100644 --- a/src/team.c +++ b/src/team.c @@ -248,17 +248,17 @@ team_get_fixture(const Team *tm, gboolean last_fixture) if(tm->clid < ID_CUP_START) for(i=0;ilen;i++) { - if(query_league_active(&lig(i)) && lig(i).id == tm->clid) + if(query_league_active(&lig(i))) { for(j=0;jlen;j++) if(g_array_index(lig(i).fixtures, Fixture, j).attendance == -1 && - query_fixture_team_involved((&g_array_index(lig(i).fixtures, Fixture, j)), tm->id)) - { - fix = &g_array_index(lig(i).fixtures, Fixture, j); - break; + query_fixture_team_involved((&g_array_index(lig(i).fixtures, Fixture, j)), tm->id) && + (fix == NULL || + query_fixture_is_earlier(&g_array_index(lig(i).fixtures, Fixture, j), fix))) + { + fix = &g_array_index(lig(i).fixtures, Fixture, j); + break; } - - break; } } @@ -287,17 +287,17 @@ team_get_fixture(const Team *tm, gboolean last_fixture) if(tm->clid < ID_CUP_START) for(i=0;ilen;i++) { - if(query_league_active(&lig(i)) && lig(i).id == tm->clid) + if(query_league_active(&lig(i))) { for(j=lig(i).fixtures->len - 1;j>=0;j--) if(g_array_index(lig(i).fixtures, Fixture, j).attendance != -1 && - query_fixture_team_involved((&g_array_index(lig(i).fixtures, Fixture, j)), tm->id)) + query_fixture_team_involved((&g_array_index(lig(i).fixtures, Fixture, j)), tm->id) && + (fix == NULL || + query_fixture_is_later(&g_array_index(lig(i).fixtures, Fixture, j), fix))) { fix = &g_array_index(lig(i).fixtures, Fixture, j); break; } - - break; } }