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

@ -331,7 +331,7 @@ launch_sat(struct plnstr *pp)
}
i = pp->pln_tech + pp->pln_effic;
if (chance(1.0 - (i / (i + 50.0)))) {
dir = DIR_FIRST + random() % 6;
dir = DIR_FIRST + roll0(6);
sx = xnorm(sx + diroff[dir][0]);
sy = ynorm(sy + diroff[dir][1]);
pr("Your trajectory was a little off.\n");