1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

Simplify LuaPseudoRandom::l_next and fix docs

Also extends the allowed range on the C++ side. This has no side-effects.
This commit is contained in:
sfan5 2024-01-10 20:08:00 +01:00
parent d20f1182f2
commit e824e9023f
5 changed files with 22 additions and 20 deletions

View file

@ -70,7 +70,7 @@ public:
PcgRandom, we cannot modify this RNG's range as it would change the
output of this RNG for reverse compatibility.
*/
if ((u32)(max - min) > (RANDOM_RANGE + 1) / 10)
if ((u32)(max - min) > (RANDOM_RANGE + 1) / 5)
throw PrngException("Range too large");
return (next() % (max - min + 1)) + min;