Core/Shared: Change rand32 to return uin32 instead of int32
Fixes a crash that happened when rand32 returned negative values. Also updated some related comments that were outdated since we changed to SFMT. Closes #12638
This commit is contained in:
1 parent
435baba1c9
commit
0b75e38755
4 files changed
+14
-21
No files matched your search
@@ -63,17 +63,17 @@ float frand(float min, float max)
|
||||
return float(GetRng()->Random() * (max - min) + min);
|
||||
}
|
||||
|
||||
int32 rand32()
|
||||
uint32 rand32()
|
||||
{
|
||||
return int32(GetRng()->BRandom());
|
||||
return GetRng()->BRandom();
|
||||
}
|
||||
|
||||
double rand_norm(void)
|
||||
double rand_norm()
|
||||
{
|
||||
return GetRng()->Random();
|
||||
}
|
||||
|
||||
double rand_chance(void)
|
||||
double rand_chance()
|
||||
{
|
||||
return GetRng()->Random() * 100.0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user