Update Random.cpp

This commit is contained in:
GabsPuNs
2026-06-05 18:28:16 -04:00
parent 98e90474c4
commit c7daaafa65

View File

@@ -74,8 +74,7 @@ int Random::nextInt()
int Random::nextInt(int n)
{
assert (n>0);
//assert (n>0); //This makes DLCs crash in Debug
if ((n & -n) == n) // i.e., n is a power of 2
return static_cast<int>((static_cast<int64_t>(next(31)) * n) >> 31); // 4J Stu - Made int64_t instead of long