summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index b24774253..37bd52d89 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1321,10 +1321,11 @@ bool IsSlopeRefused(Slope current, Slope refused)
* @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 CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTil
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 CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do
*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 tile, DoCommandFlag flags, uint32 p1, uin
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);