From dce306df5beb2be8673ff8d7ac93c06fc950ab3e Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 17 Nov 2005 03:51:16 +0000 Subject: [PATCH] fix #Q227 - cancelling items in shop entrance (trunk only) From a bug report: cancelling objects in a shop doorway or one step inside would cause the shopkeeper to brand you a thief. The relevant code is trying to handle the case where you're inside one shop and zap a wand or spell from there into another one; it didn't cope with being in the neutral area of a single shop. --- doc/fixes34.4 | 1 + src/mkobj.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 6c9ff8c45..679086ec2 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -155,6 +155,7 @@ avoid inappropriate "the corridor disappears" when vault guard gets killed avoid inappropriate "the guard calms down" if vault guard's magic corridor reaches a spot where gold is embedded in the rock adjust message for gas effect from chest trap if hero resists hallucination +cancelling non-shop objects in a shop's entrance would upset the shopkeeper Platform- and/or Interface-Specific Fixes diff --git a/src/mkobj.c b/src/mkobj.c index df05ce12c..2db928dfe 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mkobj.c 3.5 2005/09/03 */ +/* SCCS Id: @(#)mkobj.c 3.5 2005/11/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -392,6 +392,7 @@ int alter_type; use hero's location */ if (!get_obj_location(obj, &ox, &oy, CONTAINED_TOO)) ox = u.ux, oy = u.uy; + if (!costly_spot(ox, oy)) return; objroom = *in_rooms(ox, oy, SHOPBASE); /* if no shop cares about it, we're done */ if (!billable(&shkp, obj, objroom, FALSE)) return; -- 2.40.0