summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/random.c6
-rw-r--r--src/common/random.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/random.c b/src/common/random.c
index 39990f8a7..224b71fdb 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -43,10 +43,10 @@ void rnd_seed(uint32 seed)
}
-/// Generates a random number in the interval [0, UINT32_MAX]
-uint32 rnd(void)
+/// Generates a random number in the interval [0, SINT32_MAX]
+int32 rnd(void)
{
- return (uint32)genrand_int32();
+ return (int32)genrand_int31();
}
diff --git a/src/common/random.h b/src/common/random.h
index 59b609464..43dfd36c0 100644
--- a/src/common/random.h
+++ b/src/common/random.h
@@ -9,7 +9,7 @@
void rnd_init(void);
void rnd_seed(uint32);
-uint32 rnd(void);// [0, UINT32_MAX]
+int32 rnd(void);// [0, SINT32_MAX]
uint32 rnd_roll(uint32 dice_faces);// [0, dice_faces)
int32 rnd_value(int32 min, int32 max);// [min, max]
double rnd_uniform(void);// [0.0, 1.0)