]> granicus.if.org Git - nethack/commitdiff
Use macro unhideable_trap
authorPasi Kallinen <paxed@alt.org>
Mon, 18 Jul 2022 10:27:39 +0000 (13:27 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 18 Jul 2022 10:27:39 +0000 (13:27 +0300)
include/trap.h
src/bones.c
src/trap.c

index 9d16b6cd42d8d1f6ec607639c44432e33e7c52f7..18adfb2a2e4a8de6939c1b665d19e36cb02cda79 100644 (file)
@@ -101,6 +101,7 @@ enum { Trap_Effect_Finished = 0,
 
 #define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT)
 #define is_hole(ttyp)  ((ttyp) == HOLE || (ttyp) == TRAPDOOR)
+#define unhideable_trap(ttyp) ((ttyp) == HOLE) /* visible traps */
 #define undestroyable_trap(ttyp) ((ttyp) == MAGIC_PORTAL         \
                                   || (ttyp) == VIBRATING_SQUARE)
 #define is_magical_trap(ttyp) ((ttyp) == TELEP_TRAP     \
index 2b353fd0a12bb9c93f9162dabb0e1bec2f4bd804..9578f3267dfc62ed070d3bea0c0a424b1b3fd7ca 100644 (file)
@@ -510,7 +510,7 @@ savebones(int how, time_t when, struct obj *corpse)
     }
     for (ttmp = g.ftrap; ttmp; ttmp = ttmp->ntrap) {
         ttmp->madeby_u = 0;
-        ttmp->tseen = (ttmp->ttyp == HOLE);
+        ttmp->tseen = unhideable_trap(ttmp->ttyp);
     }
     resetobjs(fobj, FALSE);
     resetobjs(g.level.buriedobjlist, FALSE);
index 795599d59274538721bdc332355d858191e80f6f..39b7e7269773c6d32b851377f9b6c278ee3cc680 100644 (file)
@@ -416,7 +416,7 @@ maketrap(coordxy x, coordxy y, int typ)
     ttmp->dst.dnum = ttmp->dst.dlevel = -1;
     ttmp->madeby_u = 0;
     ttmp->once = 0;
-    ttmp->tseen = (typ == HOLE); /* hide non-holes */
+    ttmp->tseen = unhideable_trap(typ);
     ttmp->ttyp = typ;
 
     switch (typ) {