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:
DDuarte
2014-07-25 14:59:34 +01:00
parent 435baba1c9
commit 0b75e38755
4 changed files with 14 additions and 21 deletions

View File

@@ -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;
}