summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-05-01 13:09:49 +0000
committerfrosch <frosch@openttd.org>2010-05-01 13:09:49 +0000
commit910aade284ef2b3212663c81f4e15e77b1c7120d (patch)
tree1975bbb8eeb58de9cd174667fc7f7654eee89d10 /src/newgrf_industries.cpp
parent77953032274c3bb49c8b22ff7a2767412586c5a7 (diff)
downloadopenttd-910aade284ef2b3212663c81f4e15e77b1c7120d.tar.xz
(svn r19744) -Add [FS#3477]: [NewGRF] Access to random bits of houses and industries from construction callbacks 17, 28 and 2F. That is: The randombits the house/industry will start with, if construction succeeds.
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 9e50dd087..f7419149d 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -459,9 +459,10 @@ uint32 IndustryLocationGetVariable(const ResolverObject *object, byte variable,
* @param type Type of industry to build.
* @param layout Layout number.
* @param seed Seed for the random generator.
+ * @param initial_random_bits The random bits the industry is going to have after construction.
* @return Succeeded or failed command.
*/
-CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed)
+CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed, uint16 initial_random_bits)
{
const IndustrySpec *indspec = GetIndustrySpec(type);
@@ -475,6 +476,7 @@ CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uin
ind.type = type;
ind.selected_layout = layout;
ind.town = ClosestTownFromTile(tile, UINT_MAX);
+ ind.random = initial_random_bits;
NewIndustryResolver(&object, tile, &ind, type);
object.GetVariable = IndustryLocationGetVariable;