Changeset - r23479:b2ebc3136dd5
[Not reviewed]
master
0 1 0
stormcone - 5 years ago 2019-03-17 20:28:37
48624099+stormcone@users.noreply.github.com
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -260,7 +260,7 @@ int UpdateCompanyRatingAndValue(Company 
 
			/* 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;
 
		}
0 comments (0 inline, 0 general)