Prevent phaseable monster hiding deep in undiggable walls

The outer edge of a random dungeon level can have undiggable
walls.  Phaseable monsters, such as earth elementals, could
hide deep inside that boundary.  Turn the walls beyond the
first layer of non-diggable walls also non-phaseable.
This commit is contained in:
Pasi Kallinen
2026-04-02 15:43:13 +03:00
parent fc6c7d70be
commit b2a80ab87a
2 changed files with 12 additions and 5 deletions
+1
View File
@@ -1592,6 +1592,7 @@ one orc-town shaman has a higher level, affecting spellcasting
hero has a small chance of catching items thrown at them hero has a small chance of catching items thrown at them
wizard mode: history menu for #wizwish and WIZKIT wizard mode: history menu for #wizwish and WIZKIT
monster priests and wizards did not cast spells monster priests and wizards did not cast spells
prevent phaseable monsters hiding deep inside nondiggable walls
Fixes to 3.7.0-x General Problems Exposed Via git Repository Fixes to 3.7.0-x General Problems Exposed Via git Repository
+11 -5
View File
@@ -1426,8 +1426,9 @@ get_level_extends(
*bottom = ymax; *bottom = ymax;
} }
/* put a non-diggable boundary around the initial portion of a level map. /* put a non-diggable/non-phaseable boundary around the initial portion
* assumes that no level will initially put things beyond the isok() range. * of a level map. assumes that no level will initially put things
* beyond the isok() range.
* *
* we can't bound unconditionally on the last line with something in it, * we can't bound unconditionally on the last line with something in it,
* because that something might be a niche which was already reachable, * because that something might be a niche which was already reachable,
@@ -1449,9 +1450,14 @@ bound_digging(void)
for (x = 0; x < COLNO; x++) for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) for (y = 0; y < ROWNO; y++)
if (IS_STWALL(levl[x][y].typ) if (IS_STWALL(levl[x][y].typ)) {
&& (y <= ymin || y >= ymax || x <= xmin || x >= xmax)) /* undiggable walls at edges, ... */
levl[x][y].wall_info |= W_NONDIGGABLE; if (y <= ymin || y >= ymax || x <= xmin || x >= xmax)
levl[x][y].wall_info |= W_NONDIGGABLE;
/* one tile past that, everything is also unphaseable */
if (y < ymin || y > ymax || x < xmin || x > xmax)
levl[x][y].wall_info |= W_NONPASSWALL;
}
} }
void void