summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-14 09:21:05 +0000
committertron <tron@openttd.org>2005-11-14 09:21:05 +0000
commit5fa6b7eb06dd91aabde074acffab89ce00283e9e (patch)
tree0bb50211293afdb1d1e5d7c78f8c2e4d5a11506e /industry_cmd.c
parent6124ee09747fdac32a0b3af8616fd7813e0fe746 (diff)
downloadopenttd-5fa6b7eb06dd91aabde074acffab89ce00283e9e.tar.xz
(svn r3179) - RandomRange() and RandomTile() instead of home brewed versions
- CHANCE*() instead of mumbling strange numbers
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 239808c5e..292f0e042 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -937,7 +937,7 @@ static void SetupFarmFieldFence(TileIndex tile, int size, byte type, int directi
if (IsTileType(tile, MP_CLEAR) || IsTileType(tile, MP_TREES)) {
or = type;
- if (or == 1 && GB(Random(), 0, 16) <= 9362) or = 2;
+ if (or == 1 && CHANCE16(1, 7)) or = 2;
or <<= 2;
and = (byte)~0x1C;
@@ -1620,7 +1620,7 @@ Industry *CreateNewIndustry(TileIndex tile, int type)
return NULL;
/* pick a random layout */
- it = spec->table[(spec->num_table * GB(Random(), 0, 16)) >> 16];
+ it = spec->table[RandomRange(spec->num_table)];;
if (!CheckIfIndustryTilesAreFree(tile, it, type, t))
return NULL;
@@ -1810,7 +1810,7 @@ static void MaybeNewIndustry(uint32 r)
j = 2000;
for(;;) {
- i = CreateNewIndustry(TILE_MASK(Random()), type);
+ i = CreateNewIndustry(RandomTile(), type);
if (i != NULL)
break;
if (--j == 0)