summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 5026e0127..6ef7636aa 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -651,8 +651,9 @@ static void CompaniesGenStatistics()
/**
* Add monthly inflation
* @param check_year Shall the inflation get stopped after 170 years?
+ * @return true if inflation is maxed and nothing was changed
*/
-void AddInflation(bool check_year)
+bool AddInflation(bool check_year)
{
/* The cargo payment inflation differs from the normal inflation, so the
* relative amount of money you make with a transport decreases slowly over
@@ -669,7 +670,9 @@ void AddInflation(bool check_year)
* inflation doesn't add anything after that either; it even makes playing
* it impossible due to the diverging cost and income rates.
*/
- if (check_year && (_cur_year - _settings_game.game_creation.starting_year) >= (ORIGINAL_MAX_YEAR - ORIGINAL_BASE_YEAR)) return;
+ if (check_year && (_cur_year - _settings_game.game_creation.starting_year) >= (ORIGINAL_MAX_YEAR - ORIGINAL_BASE_YEAR)) return true;
+
+ if (_economy.inflation_prices == MAX_INFLATION || _economy.inflation_payment == MAX_INFLATION) return true;
/* Approximation for (100 + infl_amount)% ** (1 / 12) - 100%
* scaled by 65536
@@ -681,6 +684,8 @@ void AddInflation(bool check_year)
if (_economy.inflation_prices > MAX_INFLATION) _economy.inflation_prices = MAX_INFLATION;
if (_economy.inflation_payment > MAX_INFLATION) _economy.inflation_payment = MAX_INFLATION;
+
+ return false;
}
/**