Encapsulate direct use of random(), srandom() in chance.c

Wrap roll0() around random(), and seed_prng() around srandom().  In
preparation of replacing the PRNG.
This commit is contained in:
Markus Armbruster 2012-08-14 19:23:12 +02:00
parent 8eb78a5a80
commit 866859e912
17 changed files with 87 additions and 49 deletions

View file

@ -28,6 +28,7 @@
*
* Known contributors to this file:
* Steve McClure, 1998-2000
* Markus Armbruster, 2004-2012
*/
#include <config.h>
@ -182,7 +183,7 @@ plague_people(struct natstr *np, short *vec,
}
if (*ptime <= 0) {
*pstage -= 1;
*ptime = etus / 2 + random() % etus;
*ptime = etus / 2 + roll0(etus);
}
return stage;
}