]> granicus.if.org Git - nethack/commitdiff
Disable object pile display when hallucinating
authorPasi Kallinen <paxed@alt.org>
Wed, 1 Jun 2016 15:29:01 +0000 (18:29 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 1 Jun 2016 15:29:05 +0000 (18:29 +0300)
Hallucination shows object piles under boulders

src/mapglyph.c

index dab688620b7cb7037d83c40f9dc3d55c82710238..4ba4ee7e6fdebdc4107b7c30af4d4f9e6bb86a00 100644 (file)
@@ -54,6 +54,9 @@ static int explcolors[] = {
     (currentgraphics == ROGUESET && SYMHANDLING(H_IBM))
 #endif
 
+#define is_objpile(x,y) (!Hallucination && level.objects[(x)][(y)] \
+                         && level.objects[(x)][(y)]->nexthere)
+
 /*ARGSUSED*/
 int
 mapglyph(glyph, ochar, ocolor, ospecial, x, y)
@@ -83,7 +86,7 @@ unsigned *ospecial;
         else
             obj_color(STATUE);
         special |= MG_STATUE;
-        if (level.objects[x][y] && level.objects[x][y]->nexthere)
+        if (is_objpile(x,y))
             special |= MG_OBJPILE;
     } else if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* warn flash */
         idx = offset + SYM_OFF_W;
@@ -156,8 +159,7 @@ unsigned *ospecial;
             }
         } else
             obj_color(offset);
-        if (offset != BOULDER && level.objects[x][y]
-            && level.objects[x][y]->nexthere)
+        if (offset != BOULDER && is_objpile(x,y))
             special |= MG_OBJPILE;
     } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
         idx = mons[offset].mlet + SYM_OFF_M;
@@ -176,7 +178,7 @@ unsigned *ospecial;
         else
             mon_color(offset);
         special |= MG_CORPSE;
-        if (level.objects[x][y] && level.objects[x][y]->nexthere)
+        if (is_objpile(x,y))
             special |= MG_OBJPILE;
     } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
         idx = mons[offset].mlet + SYM_OFF_M;