]> granicus.if.org Git - nethack/commitdiff
Warning glyph description is wrong when trap symbol is same
authorPasi Kallinen <paxed@alt.org>
Fri, 15 Jan 2016 10:37:58 +0000 (12:37 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 15 Jan 2016 10:38:02 +0000 (12:38 +0200)
This fixes bz23: Warning glyph info wrong with TRAPS=50, even
though you don't set the trap symbols via TRAPS anymore, the
bug still existed. To trigger it, use SYMBOL=S_arrow_trap:2
and look at monster that appears as warning '2'.

src/pager.c

index 8157bce8ed8ab314539483e4c855cace8b0878d4..a273453f5327ad6fd9b3cdfb685675fb963882f9 100644 (file)
@@ -316,6 +316,9 @@ char *buf, *monbuf;
         int tnum = what_trap(glyph_to_trap(glyph));
 
         Strcpy(buf, defsyms[trap_to_defsym(tnum)].explanation);
+    } else if (glyph_is_warning(glyph)) {
+        int warnindx = glyph_to_warning(glyph);
+        Strcpy(buf, def_warnsyms[warnindx].explanation);
     } else if (!glyph_is_cmap(glyph)) {
         Strcpy(buf, "unexplored area");
     } else