summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-11-26 19:23:53 +0000
committermaedhros <maedhros@openttd.org>2007-11-26 19:23:53 +0000
commit24a5dd3ca25289e890e6851abc7e3188e728993d (patch)
treea51fa2316c766164cbc8f62121b9b106f335a859 /src
parent057ae477b5b08206df0c3cb35bf50ecb31af96f3 (diff)
downloadopenttd-24a5dd3ca25289e890e6851abc7e3188e728993d.tar.xz
(svn r11528) -Fix (r11500): With smooth economy enabled, industries that should only decrease production would always increase it when more than 60% was transported.
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 1aa369c5e..05da2c9dc 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2052,7 +2052,11 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
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));