mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-23 09:41:29 +00:00
Ensure that pseudo random numbers are always >0
This commit is contained in:
parent
40ff7a6b09
commit
fc2d67bac1
1 changed files with 7 additions and 2 deletions
|
@ -40,12 +40,17 @@ B64MWC(void)
|
|||
|
||||
/*
|
||||
* Generate a pseudorandom
|
||||
* signed integer.
|
||||
* integer >0.
|
||||
*/
|
||||
int
|
||||
randk(void)
|
||||
{
|
||||
return (int)KISS;
|
||||
int r;
|
||||
|
||||
r = (int)KISS;
|
||||
r = (r < 0) ? (r * -1) : r;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue