mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-08 02:53:20 +00:00
Update Random.cpp
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user