summaryrefslogtreecommitdiffstats
path: root/rogue
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-07-21 07:01:54 +0000
committerhubertf <hubertf@NetBSD.org>1998-07-21 07:01:54 +0000
commit56e441081ab7a3c68356451ea421a474435db54c (patch)
treea67db260d33d723ff99e46f645ef5c3a6c3962d6 /rogue
parent4b973b99b26ebfe9f372367f03ac93522313fac8 (diff)
downloadbsdgames-darwin-56e441081ab7a3c68356451ea421a474435db54c.tar.gz
bsdgames-darwin-56e441081ab7a3c68356451ea421a474435db54c.tar.zst
bsdgames-darwin-56e441081ab7a3c68356451ea421a474435db54c.zip
As per PR bin/5806 by Joseph Myers <jsm28@cam.ac.uk>/lash@tellabs.com:
- Init Random by time, not by pid - Fix lossage with fire-spitting, monster-killing dragons
Diffstat (limited to 'rogue')
-rw-r--r--rogue/machdep.c9
-rw-r--r--rogue/monster.c18
2 files changed, 20 insertions, 7 deletions
diff --git a/rogue/machdep.c b/rogue/machdep.c
index c195cae6..cde2bbb1 100644
--- a/rogue/machdep.c
+++ b/rogue/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.6 1997/10/12 11:45:19 lukem Exp $ */
+/* $NetBSD: machdep.c,v 1.7 1998/07/21 07:01:54 hubertf Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: machdep.c,v 1.6 1997/10/12 11:45:19 lukem Exp $");
+__RCSID("$NetBSD: machdep.c,v 1.7 1998/07/21 07:01:54 hubertf Exp $");
#endif
#endif /* not lint */
@@ -432,7 +432,10 @@ md_malloc(n)
int
md_gseed()
{
- return(getpid());
+ time_t seconds;
+
+ time(&seconds);
+ return((int) seconds);
}
/* md_exit():
diff --git a/rogue/monster.c b/rogue/monster.c
index ccb73708..c1416eb8 100644
--- a/rogue/monster.c
+++ b/rogue/monster.c
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.4 1997/10/12 11:45:28 lukem Exp $ */
+/* $NetBSD: monster.c,v 1.5 1998/07/21 07:01:55 hubertf Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)monster.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: monster.c,v 1.4 1997/10/12 11:45:28 lukem Exp $");
+__RCSID("$NetBSD: monster.c,v 1.5 1998/07/21 07:01:55 hubertf Exp $");
#endif
#endif /* not lint */
@@ -174,7 +174,7 @@ gr_monster(monster, mn)
void
mv_mons()
{
- object *monster, *next_monster;
+ object *monster, *next_monster, *test_mons;
boolean flew;
if (haste_self % 2) {
@@ -213,7 +213,17 @@ mv_mons()
if (!(flew && mon_can_go(monster, rogue.row, rogue.col))) {
mv_1_monster(monster, rogue.row, rogue.col);
}
-NM: monster = next_monster;
+NM: test_mons = level_monsters.next_monster;
+ monster = NULL;
+ while (test_mons)
+ {
+ if (next_monster == test_mons)
+ {
+ monster = next_monster;
+ break;
+ }
+ test_mons = test_mons -> next_monster;
+ }
}
}