]> granicus.if.org Git - nethack/commitdiff
fix #Q227 - cancelling items in shop entrance (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 17 Nov 2005 03:51:16 +0000 (03:51 +0000)
committernethack.rankin <nethack.rankin>
Thu, 17 Nov 2005 03:51:16 +0000 (03:51 +0000)
     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
src/mkobj.c

index 6c9ff8c4532703014384a8cc13c667051977d7ba..679086ec2b98a9a31713e00ca93ce33ebf08bdc3 100644 (file)
@@ -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
index df05ce12c961fd776b2186a6f07020e122d9d60a..2db928dfeb8c9be562084e8fa3657be1f182f234 100644 (file)
@@ -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;