From 4a1f4593d1af6a832904df2ad375d305c0d23ecb Mon Sep 17 00:00:00 2001 From: relnev Date: Thu, 9 Jan 2003 05:13:39 +0000 Subject: Random fix git-svn-id: svn://svn.icculus.org/blackshades/trunk@59 5198baeb-e213-0410-be47-fc2ff85ca46f --- Source/Support.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Source/Support.cpp') diff --git a/Source/Support.cpp b/Source/Support.cpp index b870db1..abfa176 100644 --- a/Source/Support.cpp +++ b/Source/Support.cpp @@ -1,3 +1,5 @@ +#include +#include #include #include #include @@ -11,8 +13,11 @@ int Random() { - /* holdon, will fix in a minute! */ - return rand(); +#if RAND_MAX >= 65535 + return (rand() % 65535) - 32767; +#else +#error please fix this for your platform +#endif } void Microseconds(UnsignedWide *microTickCount) -- cgit v1.2.3