forked from mirror/OpenTTD
(svn r3179) - RandomRange() and RandomTile() instead of home brewed versions
- CHANCE*() instead of mumbling strange numbers
This commit is contained in:
10
town_cmd.c
10
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,
|
||||
|
Reference in New Issue
Block a user