mirror of https://github.com/OpenTTD/OpenTTD
(svn r22010) -Feature-ette [FS#4131]: [NewGRF] Test all possible industry layouts during construction and add another pony to andy's stables
parent
28a72bbf47
commit
64280e63fb
|
@ -1782,20 +1782,16 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int count = indspec->num_table;
|
int count = indspec->num_table;
|
||||||
const IndustryTileTable * const *itt = indspec->table;
|
|
||||||
int num = GB(p1, 8, 8);
|
int num = GB(p1, 8, 8);
|
||||||
if (num >= count) return CMD_ERROR;
|
if (num >= count) return CMD_ERROR;
|
||||||
|
|
||||||
CommandCost ret = CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
CommandCost ret = CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
||||||
SmallVector<ClearedObjectArea, 1> object_areas(_cleared_object_areas);
|
|
||||||
do {
|
do {
|
||||||
if (--count < 0) return ret;
|
if (--count < 0) return ret;
|
||||||
if (--num < 0) num = indspec->num_table - 1;
|
if (--num < 0) num = indspec->num_table - 1;
|
||||||
ret = CheckIfIndustryTilesAreFree(tile, itt[num], num, it, random_initial_bits, _current_company, IACT_USERCREATION);
|
ret = CreateNewIndustryHelper(tile, it, flags, indspec, num, random_var8f, random_initial_bits, _current_company, IACT_USERCREATION, &ind);
|
||||||
_cleared_object_areas = object_areas;
|
|
||||||
} while (ret.Failed());
|
} while (ret.Failed());
|
||||||
|
|
||||||
ret = CreateNewIndustryHelper(tile, it, flags, indspec, num, random_var8f, random_initial_bits, _current_company, IACT_USERCREATION, &ind);
|
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue