summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-01-24 18:16:04 +0000
committerbelugas <belugas@openttd.org>2008-01-24 18:16:04 +0000
commit1fc0c0d2dcca7de6d325ccead6f733cf03b3d9ab (patch)
tree2328ad146fd7b4befdad38ae4f9a26bb1ef09ec9 /src
parentbd0c853e27b981710232a41fbd6288dcdaa9d9a4 (diff)
downloadopenttd-1fc0c0d2dcca7de6d325ccead6f733cf03b3d9ab.tar.xz
(svn r11976) -Fix: It seems that industries using results 0D/0E on callback cb29/35 were a bit too eager to close down.
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 967c1d385..13774b41a 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2143,9 +2143,13 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
}
}
+ /* Increase or Decreasing the production level if needed */
if (increment != 0) {
- i->prod_level = ClampU(i->prod_level + increment, 4, 0x80);
- if (i->prod_level == 4) closeit = true;
+ if !(increment < 0 && i->prod_level == 4) {
+ closeit = true;
+ } else {
+ i->prod_level = ClampU(i->prod_level + increment, 4, 0x80);
+ }
}
/* Close if needed and allowed */