src/newgrf_industries.cpp
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6878 7d1ff2f621c7
child 10242 52b4a9006029
--- a/src/newgrf_industries.cpp	Mon Apr 14 20:32:36 2008 +0000
+++ b/src/newgrf_industries.cpp	Tue Apr 15 00:47:19 2008 +0000
@@ -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
@@ -410,6 +410,7 @@
 	res->last_value      = 0;
 	res->trigger         = 0;
 	res->reseed          = 0;
+	res->count           = 0;
 }
 
 uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile)
@@ -469,7 +470,7 @@
 		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 +495,7 @@
 	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);