]> granicus.if.org Git - nethack/commitdiff
annoying shop bug
authornethack.rankin <nethack.rankin>
Sat, 23 Mar 2002 06:53:09 +0000 (06:53 +0000)
committernethack.rankin <nethack.rankin>
Sat, 23 Mar 2002 06:53:09 +0000 (06:53 +0000)
     The shop billing code assumes that food marked partly eaten
is worthless, but the eating code was changed to make sure that any
eating attempt will never leave food marked as not partly eaten.
The end result is that non-corpse food which is consumed in a
single byte can be eaten off shop floors for free, and if eaten
from inventory--so already on shop bill--the "Ix" display of used
up goods lists the item as partly eaten (with right price though).

     This fix makes single-byte food be handled the same as other
food:  the first byte taken causes the food to be auto-purchased
immediately instead of waiting until it's used up to add it to the
shopping bill.

doc/fixes34.1
src/eat.c

index f877194e718bbf1804d09c02100cbfe83e396f53..1c2df9b89424be995a2ded7a1db748a9cab03fe4 100644 (file)
@@ -5,6 +5,7 @@ General Fixes and Modified Features
 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
 
 
 Platform- and/or Interface-Specific Fixes
index 4cd2427f8385c31be5bfceee2671ad39d399ea9e..0f91cfcdf7dfb284289b0624408af2223df4bfd6 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)eat.c      3.4     2002/01/02      */
+/*     SCCS Id: @(#)eat.c      3.4     2002/03/22      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -316,8 +316,7 @@ register struct obj *otmp;
        if (!otmp->oeaten) {
            if(((!carried(otmp) && costly_spot(otmp->ox, otmp->oy) &&
                 !otmp->no_charge)
-                || otmp->unpaid) &&
-                (otmp->otyp == CORPSE || objects[otmp->otyp].oc_delay > 1)) {
+                || otmp->unpaid)) {
                /* create a dummy duplicate to put on bill */
                verbalize("You bit it, you bought it!");
                bill_dummy_object(otmp);