diff options
author | stormcone <48624099+stormcone@users.noreply.github.com> | 2019-03-17 21:28:37 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-03-17 21:28:37 +0100 |
commit | 43caef2968bccdab63896e816ee86f9d70f3c769 (patch) | |
tree | 56dd2d1769751e7d786b34095e7a60757e5a7f13 /src | |
parent | c66b9c657a90a988076abedc43e66c39a7b41763 (diff) | |
download | openttd-43caef2968bccdab63896e816ee86f9d70f3c769.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/economy.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 197298d9b..19b36e7c9 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -260,7 +260,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update) /* Skip the total */ if (i == SCORE_TOTAL) continue; /* 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; total_score += _score_info[i].score; } |