aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Utilities/Util.cpp
diff options
context:
space:
mode:
authorDDuarte <dnpd.dd@gmail.com>2014-07-25 14:59:34 +0100
committerDDuarte <dnpd.dd@gmail.com>2014-07-25 15:00:40 +0100
commit0b75e387555df6c79f4cc63b4faa715a85fbd051 (patch)
treeafce0b7be11a53eaaa00fa3e6f3e44e347914804 /src/server/shared/Utilities/Util.cpp
parent435baba1c9ecd2ac4b63d5246368c639635fc16c (diff)
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
Diffstat (limited to 'src/server/shared/Utilities/Util.cpp')
-rw-r--r--src/server/shared/Utilities/Util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index d1799913d41..bf40b8ec352 100644
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -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;
}