coverity scan CID 22585, 22586: result is not floating point

This commit is contained in:
Enno Rehling 2015-10-29 08:52:51 +01:00
parent 70d4a6af03
commit 65429a12c3

View file

@ -505,7 +505,7 @@ static double study_speedup(unit * u, skill_t s, study_rule_t rule)
skill *sv = u->skills + i;
if (sv->id == s){
learnweeks = sv->level * (sv->level + 1) / 2.0;
if (learnweeks < turn / 3) {
if (learnweeks < turn / 3.0) {
return 2.0;
}
}
@ -517,7 +517,7 @@ static double study_speedup(unit * u, skill_t s, study_rule_t rule)
skill *sv = u->skills + i;
learnweeks += (sv->level * (sv->level + 1) / 2.0);
}
if (learnweeks < turn / 2) {
if (learnweeks < turn / 2.0) {
return 2.0;
}
}