mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Replace PRNG assertions with PrngException
This commit is contained in:
@@ -115,7 +115,9 @@ u32 PcgRandom::range(u32 bound)
|
||||
|
||||
s32 PcgRandom::range(s32 min, s32 max)
|
||||
{
|
||||
assert(max >= min);
|
||||
if (max < min)
|
||||
throw PrngException("Invalid range (max < min)");
|
||||
|
||||
u32 bound = max - min + 1;
|
||||
return range(bound) + min;
|
||||
}
|
||||
|
Reference in New Issue
Block a user