From 7a95982a218246b43c663bfedaf41b5bf9fe2cd7 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 30 Dec 2004 13:53:46 +0000 Subject: [PATCH] (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. --- src/lib/commands/mfir.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 561b8123..b5633bc5 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -122,9 +122,6 @@ multifire(void) struct emp_qelem fired, defended; double odds; s_char buf[1024]; -#if defined(_WIN32) - time_t now; -#endif emp_initque(&fired); emp_initque(&defended); @@ -559,12 +556,7 @@ multifire(void) pr("Kaboom!!!\n"); prb = (double)(range2 ? (trange / range2) : 1.0); prb *= prb; -#if !defined(_WIN32) - srandom(random()); -#else - (void)time(&now); - (void)srand(now); -#endif + srandom(time(NULL)); if (chance(prb)) { pr("Wind deflects shell%s.\n", splur(shots)); /* dam = (int)((double)dam / 2.0);*/