From e28d15f4915e2f41d9c340957662ec37ac5d2a39 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 5 May 2023 17:42:57 -0700 Subject: [PATCH] endgame portal fix A recent change to prevent creating webs at water locations also deliberately prevented them at air locations but had the unintended side-effect of preventing creation of magic portals on the Planes or Air and Water. Those two levels always place the portal in air. Explicitly allow air if the trap being created is a magic portal. --- src/trap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trap.c b/src/trap.c index e48ccddd1..7ba8b0cc3 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 trap.c $NHDT-Date: 1683116409 2023/05/03 12:20:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.530 $ */ +/* NetHack 3.7 trap.c $NHDT-Date: 1683333758 2023/05/06 00:42:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.531 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -438,7 +438,8 @@ maketrap(coordxy x, coordxy y, int typ) /* old remain valid */ } else if ((IS_FURNITURE(lev->typ) && (!IS_GRAVE(lev->typ) || (typ != PIT && typ != HOLE))) - || (is_pool_or_lava(x, y) || IS_AIR(lev->typ)) + || is_pool_or_lava(x, y) + || (IS_AIR(lev->typ) && typ != MAGIC_PORTAL) || (typ == LEVEL_TELEP && single_level_branch(&u.uz))) { /* no trap on top of furniture (caller usually screens the location to inhibit this, but wizard mode wishing doesn't)