From fea939899dad7d3dd798e2b831788591465583de Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 20 Apr 2022 23:08:29 -0700 Subject: [PATCH] wishing fix (obj->dknown) A change made 5 or 6 weeks ago that was meant to enhance tracking of artifact creation had an unintended side-effect of making every object obtained via wishing have its dknown flag be set. That made them behave differenly from items picked up off the floor, so revert to the old behavior. --- doc/fixes3-7-0.txt | 2 ++ src/zap.c | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 1bc0f9099..c6a924ea4 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1156,6 +1156,8 @@ if the repeat command was used after prefix+command, only the command part got repeated the change for repeat after prefix+command would result in a crash if repeat was attempted after an unassigned key +items obtained via wishing while blind were erroneously being marked as 'seen + up close' so behaving differently from items picked up off the floor curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/zap.c b/src/zap.c index b5a47b61c..26a2317c5 100644 --- a/src/zap.c +++ b/src/zap.c @@ -5647,14 +5647,9 @@ makewish(void) return; } - if (otmp != &cg.zeroobj) { - /* treat as if seen up close even if hero is blind and hasn't - touched it yet */ - otmp->dknown = 1; - - if (otmp->oartifact) - /* update artifact bookkeeping; doesn't produce a livelog event */ - artifact_origin(otmp, ONAME_WISH | ONAME_KNOW_ARTI); + if (otmp->oartifact) { + /* update artifact bookkeeping; doesn't produce a livelog event */ + artifact_origin(otmp, ONAME_WISH | ONAME_KNOW_ARTI); } /* wisharti conduct handled in readobjnam() */