summaryrefslogtreecommitdiff
path: root/gfx.h
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2005-03-06 22:28:35 +0000
committerpasky <pasky@openttd.org>2005-03-06 22:28:35 +0000
commitb5b85a6297873b173052dc51cc9b71e423ffd0d2 (patch)
tree70de25930e42d03fba207cd384b0bf5f9c1bed8c /gfx.h
parent274f19a2bfec37ed3eb166b568cc15e0e28ed327 (diff)
downloadopenttd-b5b85a6297873b173052dc51cc9b71e423ffd0d2.tar.xz
(svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
With the original generator, e.g. Random()%44 on 100 attempts regularily generated only 22 different values! With this adjustment, the distribution is much more uniform, almost approaching the glibc's random() call. This means the random numbers are actually usable i.e. for the town names generators which almost never tried a large part of the names while others were very frequent. Note that we attempted to test whether the randomness did not degrade in some other way, and it came clean from the tests we performed. If you spot anything fishy, try without this patch, though.
Diffstat (limited to 'gfx.h')
0 files changed, 0 insertions, 0 deletions