From b541bbef1d5137f10c0f5f604cbc3dabc93c5bee Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 1 Oct 2002 08:51:28 +0000 Subject: [PATCH] sleeping shopkeeper Fix the reported problem of a sleeping shopkeeper advising you to be careful about digging. --- doc/fixes34.1 | 1 + src/shk.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 26e614b8d..1cf3156d7 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/shk.c b/src/shk.c index 15429ec35..a99408a39 100644 --- 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; -- 2.40.0