Revert changes of rand() to random() as random() was redefined in quake3.

This commit is contained in:
Thilo Schulz committed 2009-05-31 20:24:10 +00:00
1 parent b40f1507ea
commit e4d0c14f70
5 files changed
+17 -11

No files matched your search

+4 -4
View File
@@ -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 );
}