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.
This commit is contained in:
cohrs
2002-06-24 05:10:44 +00:00
parent 2daae573a3
commit 3db1e7858f
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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]));