Use is_pit macro to check for (spiked) pit

This commit is contained in:
Pasi Kallinen
2018-09-15 17:19:26 +03:00
parent bd23a56f29
commit adf070eb04
18 changed files with 52 additions and 55 deletions

View File

@@ -1349,7 +1349,7 @@ coord *tm;
m = *tm;
} else {
register int tryct = 0;
boolean avoid_boulder = (kind == PIT || kind == SPIKED_PIT
boolean avoid_boulder = (is_pit(kind)
|| kind == TRAPDOOR || kind == HOLE);
do {
@@ -1390,7 +1390,7 @@ coord *tm;
in a pit and yet not be able to identify that the pit is there. */
if (lvl <= (unsigned) rnd(4)
&& kind != SQKY_BOARD && kind != RUST_TRAP
&& kind != PIT && kind != SPIKED_PIT && kind < HOLE) {
&& !is_pit(kind) && kind < HOLE) {
/* Object generated by the trap; initially NULL, stays NULL if
we fail to generate an object or if the trap doesn't
generate objects. */