diff --git a/doc/fixes34.4 b/doc/fixes34.4 index f4982786c..23e5fe76f 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -64,6 +64,8 @@ panic on subsequent move if engulfer gets turned to stone and poly'd hero give more specific messages when dropping weapons due to slippery fingers various helmet messages changed to distinguish between "helm" and "hat" helmets don't protect against cockatrice eggs thrown straight up +breaking container contents in a shop didn't always charge for them +some types of shop theft of a stack of items only charged for a single one Platform- and/or Interface-Specific Fixes diff --git a/src/shk.c b/src/shk.c index 60a74eba8..07eb9d7ab 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)shk.c 3.4 2004/06/23 */ +/* SCCS Id: @(#)shk.c 3.4 2004/11/17 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2412,8 +2412,11 @@ register boolean peaceful, silent; value += stolen_container(obj, shkp, value, ininv); if(!ininv) gvalue += contained_gold(obj); - } else if (!obj->no_charge && saleable(shkp, obj)) { - value += get_cost(obj, shkp); + } else if (!obj->no_charge) { + /* treat items inside containers as "saleable" */ + if ((saleable(shkp, obj) || obj->where == OBJ_CONTAINED) && + (obj->oclass != FOOD_CLASS || !obj->oeaten)) + value += obj->quan * get_cost(obj, shkp); } if(gvalue + value == 0L) return(0L);