annoying shop bug

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.
This commit is contained in:
nethack.rankin
2002-03-23 06:53:09 +00:00
parent db95c38e20
commit 365a76ca28
2 changed files with 3 additions and 3 deletions

View 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

View File

@@ -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);