Avoid premapping outside Sokoban map to prevent showing stone glyphs
If user has changed the stone glyph to something other than a space (or uses a tileset), Sokoban levels showed the unreachable stone outside the map area. Prevent marking those areas as seen, so the stone glyphs aren't shown.
This commit is contained in:
@@ -1506,6 +1506,7 @@ since introduction in 3.1.0, the definition for Mitre of Holiness has specified
|
||||
no 'defends' capability for it since carrying should encompass that
|
||||
if a tree and a boulder or statue were at the same location, applying an axe
|
||||
would break the boulder or statue rather than chop the tree
|
||||
avoid premapping outside Sokoban map to prevent showing stone glyphs
|
||||
|
||||
|
||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||
|
||||
13
src/detect.c
13
src/detect.c
@@ -38,6 +38,7 @@ staticfn void foundone(coordxy, coordxy, int);
|
||||
staticfn void findone(coordxy, coordxy, genericptr_t);
|
||||
staticfn void openone(coordxy, coordxy, genericptr_t);
|
||||
staticfn int mfind0(struct monst *, boolean);
|
||||
staticfn boolean skip_premap_detect(coordxy, coordxy);
|
||||
staticfn int reveal_terrain_getglyph(coordxy, coordxy, unsigned, int,
|
||||
unsigned);
|
||||
|
||||
@@ -2117,6 +2118,16 @@ warnreveal(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* skip premap detection of areas outside Sokoban map */
|
||||
staticfn boolean
|
||||
skip_premap_detect(coordxy x, coordxy y)
|
||||
{
|
||||
if ((levl[x][y].typ == STONE)
|
||||
&& (levl[x][y].wall_info & (W_NONDIGGABLE | W_NONPASSWALL)) != 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Pre-map (the sokoban) levels */
|
||||
void
|
||||
premap_detect(void)
|
||||
@@ -2128,6 +2139,8 @@ premap_detect(void)
|
||||
/* Map the background and boulders */
|
||||
for (x = 1; x < COLNO; x++)
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
if (skip_premap_detect(x, y))
|
||||
continue;
|
||||
levl[x][y].seenv = SVALL;
|
||||
levl[x][y].waslit = TRUE;
|
||||
if (levl[x][y].typ == SDOOR)
|
||||
|
||||
Reference in New Issue
Block a user