diff --git a/src/core/random_func.hpp b/src/core/random_func.hpp --- 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