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:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 detect.c $NHDT-Date: 1721684299 2024/07/22 21:38:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.180 $ */
|
||||
/* NetHack 3.7 detect.c $NHDT-Date: 1745114235 2025/04/19 17:57:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.190 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1584,11 +1584,11 @@ do_vicinity_map(
|
||||
docrt();
|
||||
}
|
||||
|
||||
/* convert a secret door into a normal door */
|
||||
/* convert a secret door into a normal door; it might be trapped */
|
||||
void
|
||||
cvt_sdoor_to_door(struct rm *lev)
|
||||
{
|
||||
int newmask = lev->doormask & ~(WM_MASK | D_ARBOREAL);
|
||||
int newmask = lev->doormask & ~WM_MASK;
|
||||
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
/* rogue didn't have doors, only doorways */
|
||||
@@ -1600,6 +1600,7 @@ cvt_sdoor_to_door(struct rm *lev)
|
||||
}
|
||||
lev->typ = DOOR;
|
||||
lev->doormask = newmask;
|
||||
lev->arboreal_sdoor = 0; /* clears 'candig' */
|
||||
}
|
||||
|
||||
/* update the map for something which has just been found by wand of secret
|
||||
|
||||
Reference in New Issue
Block a user