From 3db1e7858ff6821664f94e968068c7489c3c605f Mon Sep 17 00:00:00 2001 From: cohrs Date: Mon, 24 Jun 2002 05:10:44 +0000 Subject: [PATCH] fix crash when using ';' to look at I monsters Reported to the mailing list. If you set your monster symbol options, and use ';' and select a known invisible monster by screen, a crash would occur accessing a null pointer. --- doc/fixes34.1 | 1 + src/pager.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 076364f1c..5cba6be94 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -118,6 +118,7 @@ prevent "remove_object: obj not on floor" panic for iron ball placement if riding while punished leads to a fall off steed when changing levels specifying -D (or -X) to enter explore mode while restarting from a save file was lost in the restore process +fix crash when using lookat on an known invisible monster with monster syms set Platform- and/or Interface-Specific Fixes diff --git a/src/pager.c b/src/pager.c index 010788355..d89e69086 100644 --- a/src/pager.c +++ b/src/pager.c @@ -531,7 +531,8 @@ do_look(quick) /* Check for monsters */ for (i = 0; i < MAXMCLASSES; i++) { - if (sym == (from_screen ? monsyms[i] : def_monsyms[i])) { + if (sym == (from_screen ? monsyms[i] : def_monsyms[i]) && + monexplain[i]) { need_to_look = TRUE; if (!found) { Sprintf(out_str, "%c %s", sym, an(monexplain[i]));