(svn r17426) -Fix (r1): economy recession would never end when economy is set to Steady while in recession

This commit is contained in:
smatz 2009-09-05 19:02:34 +00:00
parent 19ebfc84f7
commit 1776a4ecc1
1 changed files with 11 additions and 2 deletions

View File

@ -674,9 +674,18 @@ static void CompaniesPayInterest()
static void HandleEconomyFluctuations() static void HandleEconomyFluctuations()
{ {
if (_settings_game.difficulty.economy == 0) return; if (_settings_game.difficulty.economy != 0) {
/* When economy is Fluctuating, decrease counter */
_economy.fluct--;
} else if (_economy.fluct <= 0) {
/* When it's Steady and we are in recession, end it now */
_economy.fluct = -12;
} else {
/* No need to do anything else in other cases */
return;
}
if (--_economy.fluct == 0) { if (_economy.fluct == 0) {
_economy.fluct = -(int)GB(Random(), 0, 2); _economy.fluct = -(int)GB(Random(), 0, 2);
AddNewsItem(STR_NEWS_BEGIN_OF_RECESSION, NS_ECONOMY); AddNewsItem(STR_NEWS_BEGIN_OF_RECESSION, NS_ECONOMY);
} else if (_economy.fluct == -12) { } else if (_economy.fluct == -12) {