aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-31 20:24:10 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-05-31 20:24:10 +0000
commit9336c78b2584b51c30be5acbb0f8b847cd4412ed (patch)
tree18f1c617d3462360684b4ee08cb645b2b83aa075 /code/qcommon
parente3fc31a512c6636777ab81a31eff789f2d4c64ff (diff)
downloadioquake3-aero-9336c78b2584b51c30be5acbb0f8b847cd4412ed.tar.gz
ioquake3-aero-9336c78b2584b51c30be5acbb0f8b847cd4412ed.zip
Revert changes of rand() to random() as random() was redefined in quake3.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1562 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index 0f28072..fb9f664 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -2499,7 +2499,6 @@ static void Com_DetectAltivec(void)
}
}
-
/*
=================
Com_InitRand
@@ -2509,8 +2508,8 @@ Seed the random number generator, if possible with an OS supplied random seed.
static void Com_InitRand(void)
{
unsigned int seed;
-
- if(Sys_Random(&seed, sizeof(seed)))
+
+ if(Sys_RandomBytes(&seed, sizeof(seed)))
srand(seed);
else
srand(time(NULL));
@@ -3341,7 +3340,8 @@ void Com_RandomBytes( byte *string, int len )
return;
Com_Printf( "Com_RandomBytes: using weak randomization\n" );
+ srand( time( 0 ) );
for( i = 0; i < len; i++ )
- string[i] = (unsigned char)( random() % 255 );
+ string[i] = (unsigned char)( rand() % 255 );
}