From 365a76ca283717bb30cf31b7944e6e959d4e3ff0 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 23 Mar 2002 06:53:09 +0000 Subject: [PATCH] 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. --- doc/fixes34.1 | 1 + src/eat.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index f877194e7..1c2df9b89 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/eat.c b/src/eat.c index 4cd2427f8..0f91cfcdf 100644 --- 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);