From 43caef2968bccdab63896e816ee86f9d70f3c769 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Sun, 17 Mar 2019 21:28:37 +0100 Subject: [PATCH] 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. --- src/economy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/economy.cpp b/src/economy.cpp index 197298d9b2..19b36e7c9e 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(_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; }