src/industry_cmd.cpp
changeset 10439 50f056aa3024
parent 10362 20518cacbdb8
--- a/src/industry_cmd.cpp	Fri Dec 19 01:32:07 2008 +0200
+++ b/src/industry_cmd.cpp	Fri Dec 19 01:38:09 2008 +0200
@@ -1753,7 +1753,7 @@
 	if (_settings_game.difficulty.number_industries != 0) {
 		CompanyID old_company = _current_company;
 		_current_company = OWNER_NONE;
-		assert(num > 0);
+		assert(num >= 0);
 
 		do {
 			uint i;
@@ -1763,7 +1763,7 @@
 			for (i = 0; i < 2000; i++) {
 				if (CreateNewIndustry(RandomTile(), type) != NULL) break;
 			}
-		} while (--num);
+		} while (num && --num);
 
 		_current_company = old_company;
 	}