From 56e441081ab7a3c68356451ea421a474435db54c Mon Sep 17 00:00:00 2001 From: hubertf Date: Tue, 21 Jul 1998 07:01:54 +0000 Subject: [PATCH] As per PR bin/5806 by Joseph Myers /lash@tellabs.com: - Init Random by time, not by pid - Fix lossage with fire-spitting, monster-killing dragons --- rogue/machdep.c | 9 ++++++--- rogue/monster.c | 18 ++++++++++++++---- 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; + } } } -- 2.47.1