mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-16 10:21:15 +01:00
Added talents from leagues to cup definitions.
This commit is contained in:
parent
8df97f809b
commit
9bcccd7b21
14
src/cup.c
14
src/cup.c
@ -461,9 +461,17 @@ cup_load_choose_team_generate(Cup *cup, CupRound *cup_round, const CupChooseTeam
|
||||
xml_league_read((gchar*)g_ptr_array_index(sids, j), leagues);
|
||||
|
||||
for(k=0; k < g_array_index(leagues, League, leagues->len - 1).teams->len; k++)
|
||||
g_array_append_val(teams_local, g_array_index(
|
||||
g_array_index(leagues, League, leagues->len - 1).teams, Team, k));
|
||||
|
||||
{
|
||||
if(query_cup_has_property(cup->id, "league_talents"))
|
||||
{
|
||||
g_array_index(
|
||||
g_array_index(leagues, League, leagues->len - 1).teams, Team, k).average_talent =
|
||||
g_array_index(leagues, League, leagues->len - 1).average_talent;
|
||||
}
|
||||
g_array_append_val(teams_local, g_array_index(
|
||||
g_array_index(leagues, League, leagues->len - 1).teams, Team, k));
|
||||
}
|
||||
|
||||
free_g_array(&g_array_index(leagues, League, leagues->len - 1).teams);
|
||||
free_league(&g_array_index(leagues, League, leagues->len - 1));
|
||||
}
|
||||
|
10
src/team.c
10
src/team.c
@ -100,9 +100,13 @@ team_generate_players_stadium(Team *tm, gfloat av_talent)
|
||||
tm->average_talent;
|
||||
}
|
||||
else
|
||||
average_talent =
|
||||
skill_factor * team_get_average_talents(lig(0).teams) *
|
||||
(1 + cup_from_clid(tm->clid)->talent_diff);
|
||||
{
|
||||
average_talent = (tm->average_talent == 0) ?
|
||||
team_get_average_talents(lig(0).teams) *
|
||||
(1 + cup_from_clid(tm->clid)->talent_diff) :
|
||||
tm->average_talent;
|
||||
average_talent *= skill_factor;
|
||||
}
|
||||
|
||||
average_talent = CLAMP(average_talent, 0, const_float("float_player_max_skill"));
|
||||
tm->average_talent = average_talent;
|
||||
|
Loading…
Reference in New Issue
Block a user