Solving valgrind errors. Player->peak_region was not yet defined before being used.

This commit is contained in:
gunnar_g 2009-03-03 22:23:37 +00:00
parent cf77cb8b46
commit 5bcf6086e7
1 changed files with 4 additions and 4 deletions

View File

@ -141,6 +141,10 @@ youth_academy_add_new_player(YouthAcademy *youth_academy)
percentage_coach_talent_factor * av_talent *
(1 + const_float("float_youth_academy_talent_variance")));
new.peak_region =
math_gauss_dist(const_float("float_player_peak_region_lower"),
const_float("float_player_peak_region_upper"));//2;
new.talent = CLAMP(new.talent, 0, const_float("float_player_max_skill"));
new.skill = player_skill_from_talent(&new);
new.cskill = new.skill;
@ -168,10 +172,6 @@ youth_academy_add_new_player(YouthAcademy *youth_academy)
new.streak = PLAYER_STREAK_NONE;
new.streak_count = new.streak_prob = 0;
new.peak_region =
math_gauss_dist(const_float("float_player_peak_region_lower"),
const_float("float_player_peak_region_upper"));//2;
g_array_append_val(youth_academy->players, new);
}