(multifire) [_WIN32]: Rely on misc.h to provide BSD random functions.

(multifire): switch the random seeding with the current random
value to seeding with the current time.  Seeding with the
current random value does not actually improve the randomness.
This commit is contained in:
Ron Koenderink 2004-12-30 13:53:46 +00:00
parent b3ec8c14da
commit 7a95982a21

View file

@ -122,9 +122,6 @@ multifire(void)
struct emp_qelem fired, defended; struct emp_qelem fired, defended;
double odds; double odds;
s_char buf[1024]; s_char buf[1024];
#if defined(_WIN32)
time_t now;
#endif
emp_initque(&fired); emp_initque(&fired);
emp_initque(&defended); emp_initque(&defended);
@ -559,12 +556,7 @@ multifire(void)
pr("Kaboom!!!\n"); pr("Kaboom!!!\n");
prb = (double)(range2 ? (trange / range2) : 1.0); prb = (double)(range2 ? (trange / range2) : 1.0);
prb *= prb; prb *= prb;
#if !defined(_WIN32) srandom(time(NULL));
srandom(random());
#else
(void)time(&now);
(void)srand(now);
#endif
if (chance(prb)) { if (chance(prb)) {
pr("Wind deflects shell%s.\n", splur(shots)); pr("Wind deflects shell%s.\n", splur(shots));
/* dam = (int)((double)dam / 2.0);*/ /* dam = (int)((double)dam / 2.0);*/