try not including trees when check_pos() returns it's 3rd argument.

Related to #1309
https://github.com/NetHack/NetHack/issues/1309

K2 commented: "This might help - k21971/EvilHack@afed641"

A comment in there states:
"Fix: sections of wall being visible when they shouldn't yet.
This has been a long-standing bug for as long as I can remember, and qt
appears to have figured it out. What was happening: the player would all
of the sudden see a section of wall in an area that they hadn't explored
yet. It was discovered that this was only occurring if that section of
wall had any type of tree up against it."

The fix there attempts to leave trees out of the check_pos non-zero return,
so give that a shot.

I didn't attempt to reproduce the situation myself,
and therefore cannot confirm that this does resolve it.

Feedback on effectiveness or side-effects are welcomed. If someone is
able to confirm that this resolves the issue without creating new
issues, we can close it, otherwise this can be reverted.
This commit is contained in:
nhmall
2024-11-09 11:40:09 -05:00
parent 1dbba0f63b
commit 36d8998edb
2 changed files with 3 additions and 1 deletions

View File

@@ -104,6 +104,8 @@ enum levl_typ_types {
#define IS_WALL(typ) ((typ) && (typ) <= DBWALL)
#define IS_STWALL(typ) ((typ) <= DBWALL) /* STONE <= (typ) <= DBWALL */
#define IS_OBSTRUCTED(typ) ((typ) < POOL) /* absolutely nonaccessible */
#define IS_CORR(typ) ((typ) == CORR || (typ) == SCORR)
#define IS_SDOOR(typ) ((typ) == SDOOR)
#define IS_DOOR(typ) ((typ) == DOOR)
#define IS_DOORJOIN(typ) (IS_OBSTRUCTED(typ) || (typ) == IRONBARS)
#define IS_TREE(typ) \

View File

@@ -3101,7 +3101,7 @@ check_pos(coordxy x, coordxy y, int which)
if (!isok(x, y))
return which;
type = levl[x][y].typ;
if (IS_OBSTRUCTED(type) || type == CORR || type == SCORR)
if (IS_STWALL(type) || IS_CORR(type) || IS_SDOOR(type))
return which;
return 0;
}