summaryrefslogtreecommitdiffstats
path: root/rogue
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-04-02 00:13:29 +0000
committerchristos <christos@NetBSD.org>2006-04-02 00:13:29 +0000
commitfcee4ba42625b7e1dab5896c24a72a199d74f463 (patch)
treec89b2576d22202734b46d4326405fa34fca870f2 /rogue
parent2a0ca32306cf8058b56a50cfcd174303df8ec374 (diff)
downloadbsdgames-darwin-fcee4ba42625b7e1dab5896c24a72a199d74f463.tar.gz
bsdgames-darwin-fcee4ba42625b7e1dab5896c24a72a199d74f463.tar.zst
bsdgames-darwin-fcee4ba42625b7e1dab5896c24a72a199d74f463.zip
Coverity CID 2788: If no room gets returned, don't try to place a monster.
Diffstat (limited to 'rogue')
-rw-r--r--rogue/room.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rogue/room.c b/rogue/room.c
index 03155214..3ea1dd4a 100644
--- a/rogue/room.c
+++ b/rogue/room.c
@@ -1,4 +1,4 @@
-/* $NetBSD: room.c,v 1.8 2006/03/30 04:41:15 jnemeth Exp $ */
+/* $NetBSD: room.c,v 1.9 2006/04/02 00:13:29 christos Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: room.c,v 1.8 2006/03/30 04:41:15 jnemeth Exp $");
+__RCSID("$NetBSD: room.c,v 1.9 2006/04/02 00:13:29 christos Exp $");
#endif
#endif /* not lint */
@@ -490,7 +490,7 @@ dr_course(monster, entering, row, col)
/* no place to send monster */
monster->trow = NO_ROOM;
} else { /* exiting room */
- if (!get_oth_room(rn, &row, &col)) {
+ if (rn == NO_ROOM || !get_oth_room(rn, &row, &col)) {
monster->trow = NO_ROOM;
} else {
monster->trow = row;