From: PatR Date: Thu, 28 May 2015 09:22:48 +0000 (-0700) Subject: fix [pre-]beta 'Du' bug with containers in shops X-Git-Tag: NetHack-3.6.0_RC01~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e05f03bc47f13c5b228166e48f7a7c1dd171e39;p=nethack fix [pre-]beta 'Du' bug with containers in shops 'Du' in a shop was listing hero-owned containers that didn't contain any unpaid items. At least one unpaid item must be carried; bug manifested iff one or more unpaid items followed the container in the invent list. Recently revised allow_category() was using count_unpaid() for container contents incorrectly, inadvertently checking the rest of inventory after the container in addition to its contents. --- diff --git a/src/pickup.c b/src/pickup.c index 6668135a4..ce8c6f49a 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pickup.c $NHDT-Date: 1432512773 2015/05/25 00:12:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.155 $ */ +/* NetHack 3.6 pickup.c $NHDT-Date: 1432804962 2015/05/28 09:22:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.157 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -401,7 +401,7 @@ struct obj *obj; /* if unpaid is expected and obj isn't unpaid, reject (treat a container holding any unpaid object as unpaid even if isn't unpaid itself) */ if (shop_filter && !obj->unpaid - && !(Has_contents(obj) && count_unpaid(obj) > 0)) + && !(Has_contents(obj) && count_unpaid(obj->cobj) > 0)) return FALSE; /* check for particular bless/curse state */ if (bucx_filter) {