Revert changes of rand() to random() as random() was redefined in quake3.
This commit is contained in:
parent
b40f1507ea
commit
e4d0c14f70
5 changed files with 17 additions and 11 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue