(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

@@ -990,7 +990,7 @@ static int PickRandomBit(uint bits)
num++;
} while (b >>= 1);
num = GB(Random(), 0, 16) * num >> 16;
num = RandomRange(num);
for(i=0; !((bits & 1) && ((int)--num) < 0); bits>>=1,i++);
return i;