unpaid shop goods in inventory (trunk only)

Inventory display adds "(unpaid, N zorkmids)" to carried unpaid
items, but it didn't show anything comparable for indirect unpaid ones
(hero-owned containers holding shop-owned objects).  Now it will include
"(contents, N zorkmids)" in such cases.
This commit is contained in:
nethack.rankin
2006-11-04 07:49:49 +00:00
parent 86249edbf9
commit bc9f91fce5
6 changed files with 46 additions and 38 deletions

View File

@@ -827,17 +827,11 @@ ring:
Strcat(bp, " (alternate weapon; not wielded)");
}
if(obj->owornmask & W_QUIVER) Strcat(bp, " (in quiver)");
if(obj->unpaid) {
xchar ox, oy;
long quotedprice = unpaid_cost(obj);
struct monst *shkp = (struct monst *)0;
if (!iflags.suppress_price && count_unpaid(obj)) {
long quotedprice = unpaid_cost(obj, TRUE);
if (Has_contents(obj) &&
get_obj_location(obj, &ox, &oy, BURIED_TOO|CONTAINED_TOO) &&
costly_spot(ox, oy) &&
(shkp = shop_keeper(*in_rooms(ox, oy, SHOPBASE))))
quotedprice += contained_cost(obj, shkp, 0L, FALSE, TRUE);
Sprintf(eos(bp), " (unpaid, %ld %s)",
Sprintf(eos(bp), " (%s, %ld %s)",
obj->unpaid ? "unpaid" : "contents",
quotedprice, currency(quotedprice));
}
if (!strncmp(prefix, "a ", 2) &&