|
@@ -1875,25 +1875,25 @@ static void DoCreateNewIndustry(Industry
|
|
|
* @return Succeeded or failed command.
|
|
|
*
|
|
|
* @post \c *ip contains the newly created industry if all checks are successful and the \a flags request actual creation, else it contains \c NULL afterwards.
|
|
|
*/
|
|
|
static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, DoCommandFlag flags, const IndustrySpec *indspec, uint itspec_index, uint32 random_var8f, uint16 random_initial_bits, Owner founder, IndustryAvailabilityCallType creation_type, Industry **ip)
|
|
|
{
|
|
|
assert(itspec_index < indspec->num_table);
|
|
|
const IndustryTileTable *it = indspec->table[itspec_index];
|
|
|
bool custom_shape_check = false;
|
|
|
|
|
|
*ip = NULL;
|
|
|
|
|
|
SmallVector<ClearedObjectArea, 1> object_areas(_cleared_object_areas);
|
|
|
std::vector<ClearedObjectArea> object_areas(_cleared_object_areas);
|
|
|
CommandCost ret = CheckIfIndustryTilesAreFree(tile, it, itspec_index, type, random_initial_bits, founder, creation_type, &custom_shape_check);
|
|
|
_cleared_object_areas = object_areas;
|
|
|
if (ret.Failed()) return ret;
|
|
|
|
|
|
if (HasBit(GetIndustrySpec(type)->callback_mask, CBM_IND_LOCATION)) {
|
|
|
ret = CheckIfCallBackAllowsCreation(tile, type, itspec_index, random_var8f, random_initial_bits, founder, creation_type);
|
|
|
} else {
|
|
|
ret = _check_new_industry_procs[indspec->check_proc](tile);
|
|
|
}
|
|
|
if (ret.Failed()) return ret;
|
|
|
|
|
|
if (!custom_shape_check && _settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world &&
|