Commit 218de550 authored by deuce's avatar deuce
Browse files

For values of less than 2, always return zero. Prevents errors when doing

mod zero for example.
parent 996a120e
......@@ -275,9 +275,11 @@ unsigned DLLCALL xp_randomize(void)
int DLLCALL xp_random(int n)
{
#ifdef HAS_RANDOM_FUNC
if(n<2)
return(0);
return(random()%n);
#else
float f;
float f=0;
if(n<2)
return(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment