From: nethack.rankin Date: Sun, 31 Mar 2002 14:56:13 +0000 (+0000) Subject: shop fix: billing for contained items X-Git-Tag: MOVE2GIT~2841 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=994f624c0a1cc2bb88f0099f7e5ef3e6539d37e2;p=nethack shop fix: billing for contained items Shopkeeper wouldn't charge for items inside containers if you dropped one, declined to sell it, and then filled it with shop goods. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index eb398fbca..305d35eb2 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/pickup.c b/src/pickup.c index 42978c9f7..c87452b4a 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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 */ }