]> granicus.if.org Git - nethack/commitdiff
throwing and breaking glass wand in shop (trunk only)
authornethack.allison <nethack.allison>
Wed, 14 Jun 2006 23:44:16 +0000 (23:44 +0000)
committernethack.allison <nethack.allison>
Wed, 14 Jun 2006 23:44:16 +0000 (23:44 +0000)
<email deleted> wrote:
> - when in a hardware store, I put a glass wand out of a sack (the glass wand
> will cost you 266 zorkmids) and threw it in the shop => shattered into a
> thousand pieces BUT if I try to pay, I do not owe the shopkeeper anything !!!
> If I break a potion with a /oS, I have to pay !

doc/fixes35.0
src/dothrow.c

index f810953233cad73d9d36ae7411c72410bc65a1bf..f7efa6e2ecd800cd201b89ff9f16d9391fc483cd 100644 (file)
@@ -147,6 +147,7 @@ limit recursive calls to spoteffects (poly'd hero fell into water, reverted
        to human because of it, fell into same water, then crawled out twice)
 ensure that the punishment ball and chain make it into the save file after being
        temporarily orphaned from the normal chains in the swallowing code
+charge for thrown wand that shatters into a thousand pieces in a shop
 
 
 Platform- and/or Interface-Specific Fixes
index 15e30d24ae530d65aeec8c7e5591096240ab918d..fae5d3404749caad3f01b386a2b9519a3d5c9c7f 100644 (file)
@@ -703,6 +703,10 @@ register boolean broken;
                if (obj->unpaid) {
                    (void)stolen_value(obj, u.ux, u.uy,
                                       (boolean)shkp->mpeaceful, FALSE);
+                   costly_alteration(obj, COST_DSTROY);
+                   /* costly_alteration() probably already called
+                      subfrombill() for the object, but just in case it
+                      didn't, call it again. If it did, this is a NOOP. */
                    subfrombill(obj, shkp);
                }
                obj->no_charge = 1;