Changeset - r19633:3b86f3aed2aa
[Not reviewed]
master
0 2 0
frosch - 12 years ago 2012-10-01 19:29:31
frosch@openttd.org
(svn r24564) -Fix [FS#5312] (r17433): Limiting the inflation did not quite work.
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -676,8 +676,11 @@ void AddInflation(bool check_year)
 
	 * 12 -> months per year
 
	 * This is only a good approxiamtion for small values
 
	 */
 
	_economy.inflation_prices  += min((_economy.inflation_prices  * _economy.infl_amount    * 54) >> 16, MAX_INFLATION);
 
	_economy.inflation_payment += min((_economy.inflation_payment * _economy.infl_amount_pr * 54) >> 16, MAX_INFLATION);
 
	_economy.inflation_prices  += (_economy.inflation_prices  * _economy.infl_amount    * 54) >> 16;
 
	_economy.inflation_payment += (_economy.inflation_payment * _economy.infl_amount_pr * 54) >> 16;
 

	
 
	if (_economy.inflation_prices > MAX_INFLATION) _economy.inflation_prices = MAX_INFLATION;
 
	if (_economy.inflation_payment > MAX_INFLATION) _economy.inflation_payment = MAX_INFLATION;
 
}
 

	
 
/**
src/saveload/afterload.cpp
Show inline comments
 
@@ -2742,6 +2742,12 @@ bool AfterLoadGame()
 
		FOR_ALL_COMPANIES(c) c->tree_limit = _settings_game.construction.tree_frame_burst << 16;
 
	}
 

	
 
	if (IsSavegameVersionBefore(177)) {
 
		/* Fix too high inflation rates */
 
		if (_economy.inflation_prices > MAX_INFLATION) _economy.inflation_prices = MAX_INFLATION;
 
		if (_economy.inflation_payment > MAX_INFLATION) _economy.inflation_payment = MAX_INFLATION;
 
	}
 

	
 
	/* Road stops is 'only' updating some caches */
 
	AfterLoadRoadStops();
 
	AfterLoadLabelMaps();
0 comments (0 inline, 0 general)