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.
This commit is contained in:
PatR
2023-05-05 17:42:57 -07:00
parent 180042434e
commit e28d15f491

View File

@@ -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 <tx,ty> 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)