diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1321,10 +1321,11 @@ bool IsSlopeRefused(Slope current, Slope * @param itspec_index The index of the itsepc to build/fund * @param type Type of the industry. * @param initial_random_bits The random bits the industry is going to have after construction. + * @param founder Industry founder * @param [out] custom_shape_check Perform custom check for the site. * @return Failed or succeeded command. */ -static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable *it, uint itspec_index, int type, uint16 initial_random_bits, bool *custom_shape_check = NULL) +static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable *it, uint itspec_index, int type, uint16 initial_random_bits, Owner founder, bool *custom_shape_check = NULL) { bool refused_slope = false; bool custom_shape = false; @@ -1356,7 +1357,7 @@ static CommandCost CheckIfIndustryTilesA if (HasBit(its->callback_mask, CBM_INDT_SHAPE_CHECK)) { custom_shape = true; - CommandCost ret = PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index, initial_random_bits); + CommandCost ret = PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index, initial_random_bits, founder); if (ret.Failed()) return ret; } else { Slope tileh = GetTileSlope(cur_tile, NULL); @@ -1708,11 +1709,11 @@ static CommandCost CreateNewIndustryHelp *ip = NULL; - CommandCost ret = CheckIfIndustryTilesAreFree(tile, it, itspec_index, type, random_initial_bits, &custom_shape_check); + CommandCost ret = CheckIfIndustryTilesAreFree(tile, it, itspec_index, type, random_initial_bits, founder, &custom_shape_check); 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); + ret = CheckIfCallBackAllowsCreation(tile, type, itspec_index, random_var8f, random_initial_bits, founder); } else { ret = _check_new_industry_procs[indspec->check_proc](tile); } @@ -1811,7 +1812,7 @@ CommandCost CmdBuildIndustry(TileIndex t do { if (--count < 0) return ret; if (--num < 0) num = indspec->num_table - 1; - ret = CheckIfIndustryTilesAreFree(tile, itt[num], num, it, random_initial_bits); + ret = CheckIfIndustryTilesAreFree(tile, itt[num], num, it, random_initial_bits, _current_company); } while (ret.Failed()); ret = CreateNewIndustryHelper(tile, it, flags, indspec, num, random_var8f, random_initial_bits, _current_company, &ind);