--- a/industry_cmd.c Fri Oct 27 14:05:42 2006 +0000
+++ b/industry_cmd.c Fri Oct 27 15:54:24 2006 +0000
@@ -1503,22 +1503,11 @@
SET_EXPENSES_TYPE(EXPENSES_OTHER);
- /* Check if the to-be built/founded industry is available for this climate.
- * Unfortunately we have no easy way of checking, except for looping the table */
- {
- const byte *i;
- bool found = false;
+ indspec = GetIndustrySpec(p1);
- for (i = &_build_industry_types[_opt_ptr->landscape][0]; i != endof(_build_industry_types[_opt_ptr->landscape]); i++) {
- if (*i == p1) {
- found = true;
- break;
- }
- }
- if (!found) return CMD_ERROR;
- }
+ /* Check if the to-be built/founded industry is available for this climate. */
+ if (!HASBIT(indspec->climate_availability, _opt_ptr->landscape)) return CMD_ERROR;
- indspec = GetIndustrySpec(p1);
/* If the patch for raw-material industries is not on, you cannot build raw-material industries.
* Raw material industries are industries that do not accept cargo (at least for now)
* Exclude the lumber mill (only "raw" industry that can be built) */