From: PatR Date: Fri, 3 Jun 2016 00:11:13 +0000 (-0700) Subject: farlook bullet-proofing X-Git-Tag: NetHack-3.6.1_RC01~709 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94a4f57d5373b1bc41f5f84e294e4ff3321dc1ef;p=nethack farlook bullet-proofing When examining a buried object (after detection has revealed it), suppress setting of its dknown bit when hero is adjacent. [That couldn't actually happen, because the glyph on the map that we're trying to examine would be replaced by one for whatever is on the surface when sighted hero moved next to it, and an earlier clause in the same test prevents blinded hero from getting to this point.] --- diff --git a/src/pager.c b/src/pager.c index dac2bc3b5..da529f253 100644 --- a/src/pager.c +++ b/src/pager.c @@ -179,6 +179,11 @@ struct obj **obj_p; (corpse type will be known even if dknown is 0, so we don't need a touch check for cockatrice corpse--we're looking without touching) */ if (otmp && distu(x, y) <= 2 && !Blind && !Hallucination + /* redundant: we only look for an object which matches current + glyph among floor and buried objects; when !Blind, any buried + object's glyph will have been replaced by whatever is present + on the surface as soon as we moved next to its spot */ + && otmp->where == OBJ_FLOOR /* not buried */ /* terrain mode views what's already known, doesn't learn new stuff */ && !iflags.terrainmode) /* so don't set dknown when in terrain mode */ otmp->dknown = 1; /* if a pile, clearly see the top item only */