summaryrefslogtreecommitdiff
path: root/town_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 /town_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 'town_cmd.c')
-rw-r--r--town_cmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/town_cmd.c b/town_cmd.c
index 6de979765..ac02a9b85 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -569,7 +569,6 @@ static void LevelTownLand(TileIndex tile)
static void GrowTownInTile(TileIndex *tile_ptr, uint mask, int block, Town *t1)
{
- uint16 r;
int a,b,rcmd;
TileIndex tmptile;
TileInfo ti;
@@ -594,10 +593,11 @@ static void GrowTownInTile(TileIndex *tile_ptr, uint mask, int block, Town *t1)
// Randomize new road block numbers
a = block;
b = block ^ 2;
- r = GB(Random(), 0, 16);
- if (r <= 0x4000) do {
- a = GB(Random(), 0, 2);
- } while(a == b);
+ if (CHANCE16(1, 4)) {
+ do {
+ a = GB(Random(), 0, 2);
+ } while(a == b);
+ }
if (!IsRoadAllowedHere(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[a])), a)) {
// A road is not allowed to continue the randomized road,