summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-16 13:15:54 +0000
committerrubidium <rubidium@openttd.org>2010-10-16 13:15:54 +0000
commit0b67a7ccd53725f7734cb4dd45cc24edae9b9702 (patch)
treeb11501a1854e1865d002080bc8b9f1ffb45c21b2 /src/newgrf_industrytiles.cpp
parenta1b4f0b4c3b6d7074b338b4d7af4890eb16fdc65 (diff)
downloadopenttd-0b67a7ccd53725f7734cb4dd45cc24edae9b9702.tar.xz
(svn r20942) -Feature [NewGRF]: make it possible to distinguish player built/randomly placed industries in the location and land slope check callbacks
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 24deef5a4..fa1606b39 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -258,9 +258,10 @@ extern bool IsSlopeRefused(Slope current, Slope refused);
* @param itspec_index Layout.
* @param initial_random_bits Random bits of industry after construction
* @param founder Industry founder
+ * @param creation_type The circumstances the industry is created under.
* @return Suceeded or failed command.
*/
-CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder)
+CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
{
Industry ind;
ind.index = INVALID_INDUSTRY;
@@ -270,7 +271,7 @@ CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind
ind.random = initial_random_bits;
ind.founder = founder;
- uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, itspec_index, gfx, &ind, ind_tile);
+ uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, creation_type << 8 | itspec_index, gfx, &ind, ind_tile);
if (callback_res == CALLBACK_FAILED) {
if (!IsSlopeRefused(GetTileSlope(ind_tile, NULL), its->slopes_refused)) return CommandCost();
return_cmd_error(STR_ERROR_SITE_UNSUITABLE);