fix for #H9430 and github issue #1207 - gas clouds
Reported yesterday as issue #1207 by elunna and over four years ago in #H9430: monsters in gas clouds that should be shown by Warning aren't. And in some discussion of #H9430 back then: monsters adjacent to the hero while in gas clouds aren't shown on the map, but combat and other interaction describes them as if they were. There have been changes since then--to prevent seeing things on the far side of gas clouds as if there were no clouds in the way--but the basic problems with warning and adjacency weren't addressed. This is a band-aid (tm) that probably makes things livable. Don't allow gas region display to override monsters that are sensed via warning or when the hero is next to them. That part doesn't work correctly if the hero isn't blind and is inside the cloud while the monster is adjacent but outside. I think it will take more than a band-aid to deal with that sensibly. Closes #1207
This commit is contained in:
12
src/vision.c
12
src/vision.c
@@ -134,7 +134,10 @@ vision_init(void)
|
||||
/*
|
||||
* does_block()
|
||||
*
|
||||
* Returns true if something at (x,y) blocks sight.
|
||||
* Returns 0 if nothing at (x,y) blocks sight, 1 if anything other than
|
||||
* an opaque region (gas cloud rather than CLOUD terrain) blocks sight,
|
||||
* or 2 if an opaque region potions sight. [At present, the rest of the
|
||||
* code makes no distinction between 1 and 2, just between 0 and non-0.]
|
||||
*/
|
||||
int
|
||||
does_block(int x, int y, struct rm *lev)
|
||||
@@ -158,8 +161,7 @@ does_block(int x, int y, struct rm *lev)
|
||||
#ifdef DEBUG
|
||||
if (gs.seethru != 1) {
|
||||
#endif
|
||||
if (lev->typ == CLOUD || IS_WATERWALL(lev->typ)
|
||||
|| lev->typ == LAVAWALL
|
||||
if (lev->typ == CLOUD || IS_WATERWALL(lev->typ) || lev->typ == LAVAWALL
|
||||
|| (Underwater && is_moat(x, y)))
|
||||
return 1;
|
||||
#ifdef DEBUG
|
||||
@@ -181,7 +183,7 @@ does_block(int x, int y, struct rm *lev)
|
||||
#endif
|
||||
/* Clouds (poisonous or not) block light. */
|
||||
if (visible_region_at(x, y))
|
||||
return 1;
|
||||
return 2;
|
||||
#ifdef DEBUG
|
||||
} /* gs.seethru */
|
||||
#endif
|
||||
@@ -929,7 +931,7 @@ unblock_point(int x, int y)
|
||||
* + If you are a blocked spot, then your right will point to the
|
||||
* right-most blocked spot to your right that is connected to you.
|
||||
* This means that a right-edge (a blocked spot that has an open
|
||||
* spot on its right) will point to itself.
|
||||
* spot on its right) will point to itself.
|
||||
*/
|
||||
static void
|
||||
dig_point(int row, int col)
|
||||
|
||||
Reference in New Issue
Block a user