Once again, take srand()/random() out of the initialization chain.
[open-adventure.git] / misc.c
diff --git a/misc.c b/misc.c
index 7057bad5272b10ec44239d7ff848008e0564d3c8..b6ca80e3094dd7373802b7014c6314e32e4819fc 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -724,7 +724,8 @@ L2: ATDWRF=I;
 
 
 
-/*  Utility routines (SETBIT, TSTBIT, set_seed_from_time, get_next_lcg_value, randrange, RNDVOC, BUG) */
+/*  Utility routines (SETBIT, TSTBIT, set_seed, get_next_lcg_value,
+ *  randrange, RNDVOC, BUG) */
 
 #undef SETBIT
 long fSETBIT(long BIT) {
@@ -759,11 +760,9 @@ long TSTBIT;
 
 #define TSTBIT(MASK,BIT) fTSTBIT(MASK,BIT)
 
-void set_seed_from_time(void)
+void set_seed(long seedval)
 {
-  /* Use the current system time to get seed the ISO rand() function, from which we get a seed for the LCG. */
-  srand(time(NULL));
-  lcgstate.x = (unsigned long) rand() % lcgstate.m;
+  lcgstate.x = (unsigned long) seedval % lcgstate.m;
 }
 
 unsigned long get_next_lcg_value(void)