summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-03-12 15:56:56 +0000
committerfrosch <frosch@openttd.org>2008-03-12 15:56:56 +0000
commitd74445134509b39db076b04e9ccfd7590028a5d2 (patch)
tree18f4e77b7a676f42715fa6c722d13db4b96ebf7a /src
parent8af1696cd327bd77b4c98f42cce7a7b2b11b2d8d (diff)
downloadopenttd-d74445134509b39db076b04e9ccfd7590028a5d2.tar.xz
(svn r12362) -Fix (r11985, r12006): Randomize variable 8F only once per callback 28.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_industries.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index ceb705e8a..618458d6b 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -25,7 +25,7 @@
#include "table/strings.h"
-static Randomizer _industry_creation_randomizer;
+static uint32 _industry_creation_random_bits;
/* Since the industry IDs defined by the GRF file don't necessarily correlate
* to those used by the game, the IDs used for overriding old industries must be
@@ -469,7 +469,7 @@ uint32 IndustryLocationGetVariable(const ResolverObject *object, byte variable,
case 0x8D: return min(DistanceSquare(industry->town->xy, tile), 65535);
/* 32 random bits */
- case 0x8F: return _industry_creation_randomizer.Next();
+ case 0x8F: return _industry_creation_random_bits;
}
/* None of the special ones, so try the general ones */
@@ -494,7 +494,7 @@ bool CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint itspe
NewIndustryResolver(&object, tile, &ind, type);
object.GetVariable = IndustryLocationGetVariable;
object.callback = CBID_INDUSTRY_LOCATION;
- _industry_creation_randomizer.SetSeed(seed);
+ _industry_creation_random_bits = seed;
group = Resolve(GetIndustrySpec(type)->grf_prop.spritegroup, &object);