Use macro unhideable_trap

This commit is contained in:
Pasi Kallinen
2022-07-18 13:27:39 +03:00
parent 06efa695be
commit aa09f3eef5
3 changed files with 3 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ enum { Trap_Effect_Finished = 0,
#define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT) #define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT)
#define is_hole(ttyp) ((ttyp) == HOLE || (ttyp) == TRAPDOOR) #define is_hole(ttyp) ((ttyp) == HOLE || (ttyp) == TRAPDOOR)
#define unhideable_trap(ttyp) ((ttyp) == HOLE) /* visible traps */
#define undestroyable_trap(ttyp) ((ttyp) == MAGIC_PORTAL \ #define undestroyable_trap(ttyp) ((ttyp) == MAGIC_PORTAL \
|| (ttyp) == VIBRATING_SQUARE) || (ttyp) == VIBRATING_SQUARE)
#define is_magical_trap(ttyp) ((ttyp) == TELEP_TRAP \ #define is_magical_trap(ttyp) ((ttyp) == TELEP_TRAP \

View File

@@ -510,7 +510,7 @@ savebones(int how, time_t when, struct obj *corpse)
} }
for (ttmp = g.ftrap; ttmp; ttmp = ttmp->ntrap) { for (ttmp = g.ftrap; ttmp; ttmp = ttmp->ntrap) {
ttmp->madeby_u = 0; ttmp->madeby_u = 0;
ttmp->tseen = (ttmp->ttyp == HOLE); ttmp->tseen = unhideable_trap(ttmp->ttyp);
} }
resetobjs(fobj, FALSE); resetobjs(fobj, FALSE);
resetobjs(g.level.buriedobjlist, FALSE); resetobjs(g.level.buriedobjlist, FALSE);

View File

@@ -416,7 +416,7 @@ maketrap(coordxy x, coordxy y, int typ)
ttmp->dst.dnum = ttmp->dst.dlevel = -1; ttmp->dst.dnum = ttmp->dst.dlevel = -1;
ttmp->madeby_u = 0; ttmp->madeby_u = 0;
ttmp->once = 0; ttmp->once = 0;
ttmp->tseen = (typ == HOLE); /* hide non-holes */ ttmp->tseen = unhideable_trap(typ);
ttmp->ttyp = typ; ttmp->ttyp = typ;
switch (typ) { switch (typ) {