From 910aade284ef2b3212663c81f4e15e77b1c7120d Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 1 May 2010 13:09:49 +0000 Subject: (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. --- src/town_cmd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/town_cmd.cpp') diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 0fb74a45d..f6a2f0d4f 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2164,8 +2164,10 @@ static bool BuildTownHouse(Town *t, TileIndex tile) /* 1x1 house checks are already done */ } + byte random_bits = Random(); + if (HasBit(hs->callback_mask, CBM_HOUSE_ALLOW_CONSTRUCTION)) { - uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile, true); + uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile, true, random_bits); if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) == 0) continue; } @@ -2191,7 +2193,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile) } } - MakeTownHouse(tile, t, construction_counter, construction_stage, house, Random()); + MakeTownHouse(tile, t, construction_counter, construction_stage, house, random_bits); return true; } -- cgit v1.2.3-54-g00ecf