src/industry_cmd.cpp
changeset 10439 50f056aa3024
parent 10362 20518cacbdb8
equal deleted inserted replaced
10438:51bff16a04c9 10439:50f056aa3024
  1751 	num = (ind_spc->check_proc == CHECK_REFINERY || ind_spc->check_proc == CHECK_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
  1751 	num = (ind_spc->check_proc == CHECK_REFINERY || ind_spc->check_proc == CHECK_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
  1752 
  1752 
  1753 	if (_settings_game.difficulty.number_industries != 0) {
  1753 	if (_settings_game.difficulty.number_industries != 0) {
  1754 		CompanyID old_company = _current_company;
  1754 		CompanyID old_company = _current_company;
  1755 		_current_company = OWNER_NONE;
  1755 		_current_company = OWNER_NONE;
  1756 		assert(num > 0);
  1756 		assert(num >= 0);
  1757 
  1757 
  1758 		do {
  1758 		do {
  1759 			uint i;
  1759 			uint i;
  1760 
  1760 
  1761 			IncreaseGeneratingWorldProgress(GWP_INDUSTRY);
  1761 			IncreaseGeneratingWorldProgress(GWP_INDUSTRY);
  1762 
  1762 
  1763 			for (i = 0; i < 2000; i++) {
  1763 			for (i = 0; i < 2000; i++) {
  1764 				if (CreateNewIndustry(RandomTile(), type) != NULL) break;
  1764 				if (CreateNewIndustry(RandomTile(), type) != NULL) break;
  1765 			}
  1765 			}
  1766 		} while (--num);
  1766 		} while (num && --num);
  1767 
  1767 
  1768 		_current_company = old_company;
  1768 		_current_company = old_company;
  1769 	}
  1769 	}
  1770 }
  1770 }
  1771 
  1771