mirror of https://github.com/tstellar/bygfoot.git
Fix cup_get_matchdays_in_cup_round
This commit is contained in:
parent
f3b9966bcd
commit
2b926ce3e1
17
src/cup.c
17
src/cup.c
|
@ -727,15 +727,16 @@ cup_get_matchdays_in_cup_round(const Cup *cup, gint round)
|
||||||
if(cup_round->round_robin_number_of_groups > 0)
|
if(cup_round->round_robin_number_of_groups > 0)
|
||||||
{
|
{
|
||||||
number_of_teams = cup_round_get_number_of_teams(cup, round);
|
number_of_teams = cup_round_get_number_of_teams(cup, round);
|
||||||
|
number_of_teams += cup_round->round_robin_number_of_groups - 1;
|
||||||
if(number_of_teams % cup_round->round_robin_number_of_groups == 0)
|
number_of_teams /= cup_round->round_robin_number_of_groups;
|
||||||
number_of_matchdays =
|
/* Now, number_of_teams = number of teams in largest group */
|
||||||
((number_of_teams / cup_round->round_robin_number_of_groups) - 1) * 2;
|
if (number_of_teams % 2 == 0)
|
||||||
|
number_of_matchdays = number_of_teams - 1;
|
||||||
else
|
else
|
||||||
number_of_matchdays =
|
number_of_matchdays = number_of_teams;
|
||||||
((number_of_teams -
|
|
||||||
(number_of_teams % cup_round->round_robin_number_of_groups)) /
|
if (g_array_index(cup->rounds, CupRound, round).home_away)
|
||||||
cup_round->round_robin_number_of_groups) * 2;
|
number_of_matchdays *= 2;
|
||||||
}
|
}
|
||||||
else if(g_array_index(cup->rounds, CupRound, round).home_away)
|
else if(g_array_index(cup->rounds, CupRound, round).home_away)
|
||||||
number_of_matchdays = 2;
|
number_of_matchdays = 2;
|
||||||
|
|
Loading…
Reference in New Issue