mirror of https://github.com/OpenTTD/OpenTTD
Fix f58fa80e: Wrong company performance rating when money exceeds INT_MAX. (#7382)
Company performance rating calculation does not take into account the companies' money when those exceeds INT_MAX.pull/7383/head
parent
c66b9c657a
commit
43caef2968
|
@ -260,7 +260,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update)
|
||||||
/* Skip the total */
|
/* Skip the total */
|
||||||
if (i == SCORE_TOTAL) continue;
|
if (i == SCORE_TOTAL) continue;
|
||||||
/* Check the score */
|
/* Check the score */
|
||||||
s = Clamp(_score_part[owner][i], 0, _score_info[i].needed) * _score_info[i].score / _score_info[i].needed;
|
s = Clamp<int64>(_score_part[owner][i], 0, _score_info[i].needed) * _score_info[i].score / _score_info[i].needed;
|
||||||
score += s;
|
score += s;
|
||||||
total_score += _score_info[i].score;
|
total_score += _score_info[i].score;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue