fix #Q251 - reading engravings while asleep

From a bug report, floating down onto an engraving
due to levitation timeout would yield "You read: <engraving text>" 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 <object> here" if there was an object instead of or in addition to
an engraving.
This commit is contained in:
nethack.rankin
2006-02-04 04:06:16 +00:00
parent 702060c4de
commit fbe6b0278f
2 changed files with 10 additions and 1 deletions

View File

@@ -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 */