From: Pasi Kallinen Date: Mon, 18 Jul 2022 10:27:39 +0000 (+0300) Subject: Use macro unhideable_trap X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa09f3eef5e4b5e3f3fc223febc20f49ead1e703;p=nethack Use macro unhideable_trap --- diff --git a/include/trap.h b/include/trap.h index 9d16b6cd4..18adfb2a2 100644 --- a/include/trap.h +++ b/include/trap.h @@ -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 \ diff --git a/src/bones.c b/src/bones.c index 2b353fd0a..9578f3267 100644 --- a/src/bones.c +++ b/src/bones.c @@ -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); diff --git a/src/trap.c b/src/trap.c index 795599d59..39b7e7269 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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) {