secret doors in Garden filled rooms, take two

A comment in rm.h claimed that secret doors can't be trapped so I
used door flag D_TRAPPED to handle secret doors that should be shown
as trees instead of walls.  But the comment was inaccurate and secret
doors can be trapped.

Such trapped secret doors in ordinary rooms ended up being shown as
trees too.  Switch from using D_ARBOREAL in levl[][].doormask to new
levl[][].arboreal_sdoor which overloads levl[][].candig.

Also, wizard mode wishing for secret doors needed updating to allow
creating trapped ones (at wall or door locations).

This ought to update EDITLEVEL but I think existing save files can
live with secret door display issues.  Untrapped secret doors in
garden-fill rooms will end up becoming trapped.

Replaces the fix for github issue #1309
This commit is contained in:
PatR
2025-04-19 11:23:29 -07:00
parent 96a750d99e
commit 4b7e330f3a
5 changed files with 22 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mkmaze.c $NHDT-Date: 1737387068 2025/01/20 07:31:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.176 $ */
/* NetHack 3.7 mkmaze.c $NHDT-Date: 1745114235 2025/04/19 17:57:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -81,7 +81,7 @@ set_levltyp(coordxy x, coordxy y, schar newtyp)
/* hack for secret doors in garden theme rooms */
if (oldtyp == SDOOR && newtyp == AIR) {
/* levl[][].typ stays SDOOR rather than change to AIR */
levl[x][y].doormask |= D_ARBOREAL;
levl[x][y].arboreal_sdoor = 1;
return TRUE;
}