Changeset - r7972:d4b63e5f9598
[Not reviewed]
master
0 1 0
maedhros - 17 years ago 2007-11-26 19:23:53
maedhros@openttd.org
(svn r11528) -Fix (r11500): With smooth economy enabled, industries that should only decrease production would always increase it when more than 60% was transported.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -2049,13 +2049,17 @@ static void ChangeIndustryProduction(Ind
 
			for (byte j = 0; j < 2 && i->produced_cargo[j] != CT_INVALID; j++){
 
				int old_prod, new_prod, percent;
 
				int mult = (i->last_month_pct_transported[j] > PERCENT_TRANSPORTED_60) ? 1 : -1;
 

	
 
				new_prod = old_prod = i->production_rate[j];
 

	
 
				if (only_decrease || Chance16(1, 3)) mult *= -1;
 
				if (only_decrease) {
 
					mult = -1;
 
				} else if (Chance16(1, 3)) {
 
					mult *= -1;
 
				}
 

	
 
				if (Chance16(1, 22)) {
 
					new_prod += mult * (max(((RandomRange(50) + 10) * old_prod) >> 8, 1U));
 
				}
 

	
 
				/* Prevent production to overflow or Oil Rig passengers to be over-"produced" */
0 comments (0 inline, 0 general)