]> granicus.if.org Git - nethack/commitdiff
sleeping shopkeeper
authornethack.rankin <nethack.rankin>
Tue, 1 Oct 2002 08:51:28 +0000 (08:51 +0000)
committernethack.rankin <nethack.rankin>
Tue, 1 Oct 2002 08:51:28 +0000 (08:51 +0000)
     Fix the reported problem of a sleeping shopkeeper advising you
to be careful about digging.

doc/fixes34.1
src/shk.c

index 26e614b8de3fc6ebe26ad5da61c1cfc1e25f3b3f..1cf3156d79f10e31f5ea03e3193d6862fe7eb4fd 100644 (file)
@@ -263,6 +263,7 @@ likewise for currently quivered ammo among choices for 'Q'
 only include unknown gems as likely choices when applying known touchstone
 prevent mbodypart() from returning animal parts for lights
 removing a ring might relearn what it is after amnesia
+sleeping shopkeeper shouldn't talk to digging player
 
 
 Platform- and/or Interface-Specific Fixes
index 15429ec3540e9aa4715b980782ef774d18d6f9a9..a99408a39db197f874725c360d9bdf0e3290ee6b 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)shk.c      3.4     2002/04/12      */
+/*     SCCS Id: @(#)shk.c      3.4     2002/09/28      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -3303,14 +3303,17 @@ shopdig(fall)
 register int fall;
 {
     register struct monst *shkp = shop_keeper(*u.ushops);
-    int lang = 0;
-    char *grabs = "grabs";
+    int lang;
+    const char *grabs = "grabs";
 
     if(!shkp) return;
 
     /* 0 == can't speak, 1 == makes animal noises, 2 == speaks */
-    if (!is_silent(shkp->data) && shkp->data->msound <= MS_ANIMAL)
-       lang = 1;
+    lang = 0;
+    if (shkp->msleeping || !shkp->mcanmove || is_silent(shkp->data))
+       ;       /* lang stays 0 */
+    else if (shkp->data->msound <= MS_ANIMAL)
+       lang = 1;
     else if (shkp->data->msound >= MS_HUMANOID)
        lang = 2;