]> granicus.if.org Git - nethack/commitdiff
shop fix: billing for contained items
authornethack.rankin <nethack.rankin>
Sun, 31 Mar 2002 14:56:13 +0000 (14:56 +0000)
committernethack.rankin <nethack.rankin>
Sun, 31 Mar 2002 14:56:13 +0000 (14:56 +0000)
     Shopkeeper wouldn't charge for items inside containers if you
dropped one, declined to sell it, and then filled it with shop goods.

doc/fixes34.1
src/pickup.c

index eb398fbcaa6205e82aef60d26e1f01b1e10ae385..305d35eb2b31feee8e6d210961603e1451bd78f2 100644 (file)
@@ -6,6 +6,7 @@ prevent panic() obj_not_free when pushing a boulder over a landmine
 there was no feedback when successfully hitting shock resistant monsters
        with Mjollnir via hand-to-hand attack
 unbought single-bite food eaten in shops was not billed properly
+charge for shop contents inside "no charge" containers
 add wishing for "nothing" and genociding "none" to the conduct section
        of the Guidebook
 allow both wishing and genocide to accept either "none" or "nothing" when
index 42978c9f735188c11be783c1a2dcaa0edbdfc238..c87452b4a9e4af8973df78608524e5474d153093 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)pickup.c   3.4     2001/03/14      */
+/*     SCCS Id: @(#)pickup.c   3.4     2002/03/30      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1275,10 +1275,7 @@ pick_obj(otmp)
 struct obj *otmp;
 {
        obj_extract_self(otmp);
-       if (otmp->no_charge) {
-           /* this attribute only applies to objects outside invent */
-           otmp->no_charge = 0;
-       } else if (otmp != uball && costly_spot(otmp->ox, otmp->oy)) {
+       if (otmp != uball && costly_spot(otmp->ox, otmp->oy)) {
            char saveushops[5], fakeshop[2];
 
            /* addtobill cares about your location rather than the object's;
@@ -1295,6 +1292,8 @@ struct obj *otmp;
            if (!index(u.ushops, *fakeshop))
                remote_burglary(otmp->ox, otmp->oy);
        }
+       if (otmp->no_charge)    /* only applies to objects outside invent */
+           otmp->no_charge = 0;
        if (Invisible) newsym(otmp->ox, otmp->oy);
        return addinv(otmp);    /* might merge it with other objects */
 }