diff --git a/src/dig.c b/src/dig.c index 7ea05bc07..93c64c5bf 100644 --- a/src/dig.c +++ b/src/dig.c @@ -194,8 +194,8 @@ dig_check(struct monst *madeby, boolean verbose, coordxy x, coordxy y) pline_The("throne is too hard to break apart."); return FALSE; } else if (IS_ALTAR(levl[x][y].typ) - && (madeby != BY_OBJECT || Is_astralevel(&u.uz) - || Is_sanctum(&u.uz))) { + && (madeby != BY_OBJECT + || (altarmask_at(x, y) & AM_SANCTUM) != 0)) { if (verbose) pline_The("altar is too hard to break apart."); return FALSE; diff --git a/src/trap.c b/src/trap.c index 0989ed7da..77a99ea0d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -470,8 +470,9 @@ maketrap(coordxy x, coordxy y, int typ) || (u.utraptype == TT_LAVA && !is_lava(x, y)))) reset_utrap(FALSE); /* old remain valid */ - } else if ((IS_FURNITURE(lev->typ) - && (!IS_GRAVE(lev->typ) || (typ != PIT && typ != HOLE))) + } else if (!CAN_OVERWRITE_TERRAIN(lev->typ) + || (IS_FURNITURE(lev->typ) + && (typ != PIT && typ != HOLE)) || is_pool_or_lava(x, y) || (IS_AIR(lev->typ) && typ != MAGIC_PORTAL) || (typ == LEVEL_TELEP && single_level_branch(&u.uz))) {