Skip to content
Snippets Groups Projects
Commit c299f7f6 authored by rswindell's avatar rswindell
Browse files

Removed auto-seeding "feature" in xp_random(), only worked predictably in

single-threaded Unix apps. :-)
parent 83d33d41
No related branches found
No related tags found
No related merge requests found
......@@ -201,13 +201,7 @@ char* strrev(char* str)
int DLLCALL xp_random(int n)
{
float f;
static BOOL initialized;
if(!initialized) {
srand(time(NULL)); /* seed random number generator */
rand(); /* throw away first result */
initialized=TRUE;
}
if(n<2)
return(0);
f=(float)rand()/(float)RAND_MAX;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment