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

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