From 256724c39f2eabab93bdbf299f6fad72e2a64845 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 11 Mar 2005 17:01:38 +0000 Subject: [PATCH] (multifire, new): Reseeding the PRNG with the current time is not a good idea. Letting players trigger it is an extraordinarily bad idea. Remove. --- src/lib/commands/mfir.c | 1 - src/lib/commands/new.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 33c88bbd..aa2900b5 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -553,7 +553,6 @@ multifire(void) pr("Kaboom!!!\n"); prb = (double)(range2 ? (trange / range2) : 1.0); prb *= prb; - srandom(time(NULL)); if (chance(prb)) { pr("Wind deflects shell%s.\n", splur(shots)); /* dam = (int)((double)dam / 2.0);*/ diff --git a/src/lib/commands/new.c b/src/lib/commands/new.c index 7dcbe042..b864d98a 100644 --- a/src/lib/commands/new.c +++ b/src/lib/commands/new.c @@ -103,7 +103,6 @@ new(void) return RET_SYN; } } else { - srandom(time(NULL)); for (i = 0; i < 300 && !player->aborted; i++) { /* Both x and y should be either odd or even */ x = (random() % WORLD_X) - (WORLD_X / 2);