summaryrefslogtreecommitdiff
path: root/src/core/random_func.hpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-16 21:21:54 +0000
committerfrosch <frosch@openttd.org>2010-04-16 21:21:54 +0000
commit2141ca23687b538ad5c537fc468b61bfc3b01bc2 (patch)
treee3283f1151ac31f0a09f2469d2063748ff415a93 /src/core/random_func.hpp
parentd1c3234918fce4aae945eded5ecf0ed527bb000b (diff)
downloadopenttd-2141ca23687b538ad5c537fc468b61bfc3b01bc2.tar.xz
(svn r19643) -Fix (r19120): Industry generation failed for large maps and lots of industry types.
Diffstat (limited to 'src/core/random_func.hpp')
-rw-r--r--src/core/random_func.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/random_func.hpp b/src/core/random_func.hpp
index d0e12ba92..03d49d718 100644
--- a/src/core/random_func.hpp
+++ b/src/core/random_func.hpp
@@ -99,8 +99,9 @@ void SetRandomSeed(uint32 seed);
return _random.Next();
}
- static FORCEINLINE uint32 RandomRange(uint16 max)
+ static FORCEINLINE uint32 RandomRange(uint max)
{
+ assert(max <= UINT16_MAX);
return _random.Next(max);
}
#endif