(svn r3179) - RandomRange() and RandomTile() instead of home brewed versions

- CHANCE*() instead of mumbling strange numbers
This commit is contained in:
tron
2005-11-14 09:21:05 +00:00
parent 6124ee0974
commit 5fa6b7eb06
5 changed files with 14 additions and 15 deletions

View File

@@ -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,