prices of items on shop floor

get_cost_of_item() was giving different information from shop #chat
when dealing with containers owned by hero containing objects owned
by the shop.  And when it was legitimately reporting a price of 0,
doname_with_price() wasn't reporting 'no charge' for items inside a
shop that were owned by hero or that shopkeeper didn't care about.

Extend the shop price reveal to far-look, but only when hero and item
being examined are inside the same shop.
This commit is contained in:
PatR
2018-12-25 13:48:51 -08:00
parent 99cd9ea264
commit 3aca92215c
4 changed files with 25 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pager.c $NHDT-Date: 1545595360 2018/12/23 20:02:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
/* NetHack 3.6 pager.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -223,7 +223,8 @@ int x, y, glyph;
if (otmp) {
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
? distant_name(otmp, doname_vague_quan)
? distant_name(otmp, otmp->dknown ? doname_with_price
: doname_vague_quan)
: obj_descr[STRANGE_OBJECT].oc_name);
if (fakeobj)
dealloc_obj(otmp), otmp = 0;