From 5534eab5141e80d06082583148bb741c3021e45e Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 13 Apr 2019 15:57:16 -0700 Subject: [PATCH] probing fix For the inventory of a probed monster, if the probing took place in a shop the inventory display would have selling price appended to all the items. That wouldn't really be a problem if it was just for a pet who was carrying one shop item, but it applied to every item being carried by any probed monster (including shopkeeper) with no regard for whether the shop actually claimed ownership. --- doc/fixes36.2 | 4 +++- src/invent.c | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index b550c2a06..360e0de82 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.301 $ $NHDT-Date: 1555022325 2019/04/11 22:38:45 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.302 $ $NHDT-Date: 1555196229 2019/04/13 22:57:09 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -467,6 +467,8 @@ when engulfed while in a shop, dropping an item into the engulfer and then using ':' to look at current location could cause a crash when items were on the floor just inside a shop's door where the shopkeeper doesn't buy and sell stuff, those items showed a 'for sale' price +probing a monster inside a shop (including shopkeeper) showed 'for sale' + price for items in monster's minvent applying a container while inside a shop and initiating a put-in operation would show non-empty containers in inventory--including the one being applied--with "for sale" amounts for the prices of their contents diff --git a/src/invent.c b/src/invent.c index 3d502673f..ff69de77e 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 invent.c $NHDT-Date: 1549075239 2019/02/02 02:40:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.252 $ */ +/* NetHack 3.6 invent.c $NHDT-Date: 1555196229 2019/04/13 22:57:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.253 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4303,12 +4303,17 @@ char *title; * displaying 'weapon in claw', etc. properly. */ youmonst.data = mon->data; + /* in case inside a shop, don't append "for sale" prices */ + iflags.suppress_price++; n = query_objlist(title ? title : tmp, &(mon->minvent), (INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0)), &selected, pickings, do_all ? allow_all : worn_wield_only); - set_uasmon(); + + iflags.suppress_price--; + /* was 'set_uasmon();' but that potentially has side-effects */ + youmonst.data = &mons[u.umonnum]; /* most basic part of set_uasmon */ } else { invdisp_nothing(title ? title : tmp, "(none)"); n = 0;