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.
This commit is contained in:
PatR
2019-04-13 15:57:16 -07:00
parent fa98c6fb72
commit 5534eab514
2 changed files with 10 additions and 3 deletions

View File

@@ -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

View File

@@ -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;