diff options
author | hubertf <hubertf@NetBSD.org> | 1998-07-21 07:01:54 +0000 |
---|---|---|
committer | hubertf <hubertf@NetBSD.org> | 1998-07-21 07:01:54 +0000 |
commit | 56e441081ab7a3c68356451ea421a474435db54c (patch) | |
tree | a67db260d33d723ff99e46f645ef5c3a6c3962d6 /rogue/monster.c | |
parent | 4b973b99b26ebfe9f372367f03ac93522313fac8 (diff) | |
download | bsdgames-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/monster.c')
-rw-r--r-- | rogue/monster.c | 18 |
1 files changed, 14 insertions, 4 deletions
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; + } } } |