summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-05-29 13:08:50 +0000
committerfrosch <frosch@openttd.org>2010-05-29 13:08:50 +0000
commite296eeb20cc0f6f0ff918fb6372e657dc4a44647 (patch)
tree1cf26417d28f61d856e9c2b93ee0cdf254652140 /src/industry_cmd.cpp
parent0c1add2d1953219d7f408f9090d3835ead8e1b73 (diff)
downloadopenttd-e296eeb20cc0f6f0ff918fb6372e657dc4a44647.tar.xz
(svn r19901) -Add: [NewGRF] Access to industry founder (var A7) during callbacks 28 and 2F. (yexo)
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);