From fbe6b0278f03b9fb29bcbd94624b46748474815a Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 4 Feb 2006 04:06:16 +0000 Subject: [PATCH] fix #Q251 - reading engravings while asleep From a bug report, floating down onto an engraving due to levitation timeout would yield "You read: " even if you were asleep at the time. Random teleport while asleep could produce a similar result. The problem was actually a little bigger: you'd also get "You see here" if there was an object instead of or in addition to an engraving. --- doc/fixes35.0 | 2 ++ src/pickup.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 8a8b85e50..1b56640b5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -113,6 +113,8 @@ reduced message verbosity when monster with multiple attacks missed wildly zapping a never seen wand while blinded won't make the wand a discovery zapping an unID'd wand of teleportation at self will discover it (usually) zapping unlocking magic at self while punished will remove attached chain +don't see objects or read engraving when hero changes location (random + teleport) or position (levitation timeout) while asleep or fainted Platform- and/or Interface-Specific Fixes diff --git a/src/pickup.c b/src/pickup.c index 049ad7383..2d1657418 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)pickup.c 3.5 2005/12/07 */ +/* SCCS Id: @(#)pickup.c 3.5 2006/02/03 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -424,6 +424,13 @@ int what; /* should be a long */ struct obj *objchain; int traverse_how; + /* we might have arrived here while fainted or sleeping, via + random teleport or levitation timeout; if so, skip check_here + and read_engr_at in addition to bypassing autopickup itself + [probably ought to check whether hero is using a cockatrice + corpse for a pillow here... (also at initial faint/sleep)] */ + if (autopickup && multi < 0 && unconscious()) return 0; + if (what < 0) /* pick N of something */ count = -what; else /* pick anything */ -- 2.40.0