From: PatR Date: Wed, 26 Dec 2018 01:07:45 +0000 (-0800) Subject: container_contents() vs show goods X-Git-Tag: NetHack-3.6.2_Released~119^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cae50298b653b45fe8137caf5cd66ba172caf6a1;p=nethack container_contents() vs show goods Fix another inconsistency with containers in shops: prices shown when looking inside. Apply had them (because shop goods in containers are flagged as 'unpaid' when hero carries the container), and loot did not (because they aren't flagged that way). --- diff --git a/doc/fixes36.2 b/doc/fixes36.2 index d5e938a76..120e67360 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -307,6 +307,8 @@ unlike #chat in a shop, walking on an item in a shop failed to include price for hero-owned container holding shop-owned items bag of holding explosion inside shop billed hero for unpaid contents if it happened when applied while carried but not when looted while on floor +looking into an applied container with ':' showed prices of unpaid items but + looking into a looted one with ':' did not show prices for shop items Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/end.c b/src/end.c index cb966162f..ee2df7537 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 end.c $NHDT-Date: 1545771927 2018/12/25 21:05:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.161 $ */ +/* NetHack 3.6 end.c $NHDT-Date: 1545786454 2018/12/26 01:07:34 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.162 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1599,7 +1599,7 @@ boolean identified, all_containers, reportempty; if (Is_container(obj) || obj->otyp == STATUE) obj->cknown = obj->lknown = 1; } - Strcpy(&buf[2], doname(obj)); + Strcpy(&buf[2], doname_with_price(obj)); putstr(tmpwin, 0, buf); } unsortloot(&sortedcobj); diff --git a/src/shk.c b/src/shk.c index de436de87..40c58adb5 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 shk.c $NHDT-Date: 1545785119 2018/12/26 00:45:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.146 $ */ +/* NetHack 3.6 shk.c $NHDT-Date: 1545786461 2018/12/26 01:07:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.147 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1974,7 +1974,7 @@ register struct obj *obj; if (*u.ushops && obj->oclass != COIN_CLASS && obj != uball && obj != uchain - && get_obj_location(obj, &x, &y, 0) + && get_obj_location(obj, &x, &y, CONTAINED_TOO) && *in_rooms(u.ux, u.uy, SHOPBASE) == *in_rooms(x, y, SHOPBASE) && (shkp = shop_keeper(inside_shop(x, y))) != 0 && inhishop(shkp)) { cost = obj->no_charge ? 0L : obj->quan * get_cost(obj, shkp);