diff options
author | frosch <frosch@openttd.org> | 2010-04-17 11:49:25 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-04-17 11:49:25 +0000 |
commit | 184fa43df2e14c73162e641bc9bc83e403f069ed (patch) | |
tree | d24d525121ba0120bd172975ee2e0784035f7128 /src/industry_cmd.cpp | |
parent | cd20724d201b5b04c8dfac49b6b885ea988165ed (diff) | |
download | openttd-184fa43df2e14c73162e641bc9bc83e403f069ed.tar.xz |
(svn r19652) -Fix: RandomRange() is used for bigger ranges in many cases, so generally extent it to handle 32 bits.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 2b1170aba..f25ada8c3 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1923,8 +1923,7 @@ void GenerateIndustries() /* Add the remaining industries according to their probabilities */ for (uint i = 0; i < total_amount; i++) { - /* RandomRange() can only deal with 16 bit, which is not enough here. */ - uint32 r = ((uint64)Random() * (uint64)total_prob) >> 32; + uint32 r = RandomRange(total_prob); IndustryType it = 0; while (it < NUM_INDUSTRYTYPES && r >= industry_probs[it]) { r -= industry_probs[it]; |