(svn r11976) -Fix: It seems that industries using results 0D/0E on callback cb29/35 were a bit too eager to close down.
authorbelugas
Thu, 24 Jan 2008 18:16:04 +0000
changeset 8406 0f86dbef7522
parent 8405 097e8e94180b
child 8407 300670fddaae
(svn r11976) -Fix: It seems that industries using results 0D/0E on callback cb29/35 were a bit too eager to close down.
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Thu Jan 24 17:32:03 2008 +0000
+++ b/src/industry_cmd.cpp	Thu Jan 24 18:16:04 2008 +0000
@@ -2143,9 +2143,13 @@
 		}
 	}
 
+	/* 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 */