fix issue #1309 - secret doors in Garden rooms
Issue reported by elunna: when a room gets converted into a theme room with fill type Garden, its walls are changed to trees but any secret doors in those walls are still displayed as regular walls. This adds a new D_ARBOREAL flag for secret doors, used to force them to be displayed as a tree instead of a wall. Fixes #1309
This commit is contained in:
@@ -1588,7 +1588,7 @@ do_vicinity_map(
|
||||
void
|
||||
cvt_sdoor_to_door(struct rm *lev)
|
||||
{
|
||||
int newmask = lev->doormask & ~WM_MASK;
|
||||
int newmask = lev->doormask & ~(WM_MASK | D_ARBOREAL);
|
||||
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
/* rogue didn't have doors, only doorways */
|
||||
|
||||
@@ -2289,6 +2289,13 @@ back_to_glyph(coordxy x, coordxy y)
|
||||
case CORR:
|
||||
idx = (ptr->waslit || flags.lit_corridor) ? S_litcorr : S_corr;
|
||||
break;
|
||||
case SDOOR:
|
||||
if ((ptr->doormask & D_ARBOREAL) != 0) {
|
||||
idx = S_tree;
|
||||
break;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
/*FALLTHRU*/
|
||||
case HWALL:
|
||||
case VWALL:
|
||||
case TLCORNER:
|
||||
@@ -2300,7 +2307,6 @@ back_to_glyph(coordxy x, coordxy y)
|
||||
case TDWALL:
|
||||
case TLWALL:
|
||||
case TRWALL:
|
||||
case SDOOR:
|
||||
idx = ptr->seenv ? wall_angle(ptr) : S_stone;
|
||||
break;
|
||||
case DOOR:
|
||||
@@ -3579,6 +3585,10 @@ wall_angle(struct rm *lev)
|
||||
break;
|
||||
|
||||
case SDOOR:
|
||||
if ((lev->doormask & D_ARBOREAL) != 0) {
|
||||
idx = S_tree;
|
||||
break;
|
||||
}
|
||||
if (lev->horizontal)
|
||||
goto horiz;
|
||||
FALLTHROUGH;
|
||||
|
||||
12
src/mkmaze.c
12
src/mkmaze.c
@@ -76,8 +76,16 @@ boolean
|
||||
set_levltyp(coordxy x, coordxy y, schar newtyp)
|
||||
{
|
||||
if (isok(x, y) && newtyp >= STONE && newtyp < MAX_TYPE) {
|
||||
if (CAN_OVERWRITE_TERRAIN(levl[x][y].typ)) {
|
||||
schar oldtyp = levl[x][y].typ;
|
||||
schar oldtyp = levl[x][y].typ;
|
||||
|
||||
/* 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;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (CAN_OVERWRITE_TERRAIN(oldtyp)) {
|
||||
/* typ==ICE || (typ==DRAWBRIDGE_UP && drawbridgemask==DB_ICE) */
|
||||
boolean was_ice = is_ice(x, y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user