redundant feedback for `I u'
When 3.4.0 added the shop price to inventory display of unpaid items, it resulted in showing that price twice if you used the `I u' command while carrying just one unpaid object. k - a potion of object detection (unpaid, 150 zorkmids) 150 zorkmids With two or more unpaid objects it uses a menu style display and explicitly suppresses "(unpaid, N zorkmids)" from the inventory formatting. Do the same suppression when there's one item. k - a potion of object detection 150 zorkmids
This commit is contained in:
@@ -108,6 +108,7 @@ fix some cases where movement was disallowed but the hero was still conscious
|
|||||||
after destroying drawbridge, hero could appear to be in the wall
|
after destroying drawbridge, hero could appear to be in the wall
|
||||||
sometimes shop items which hero is forced to buy could be sold back twice
|
sometimes shop items which hero is forced to buy could be sold back twice
|
||||||
vision was not updated when polymorphing a statue into a boulder
|
vision was not updated when polymorphing a statue into a boulder
|
||||||
|
`I u' when carrying single unpaid item listed its cost twice
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
46
src/invent.c
46
src/invent.c
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)invent.c 3.5 2005/02/07 */
|
/* SCCS Id: @(#)invent.c 3.5 2005/04/06 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1923,7 +1923,6 @@ dounpaid()
|
|||||||
register char ilet;
|
register char ilet;
|
||||||
char *invlet = flags.inv_order;
|
char *invlet = flags.inv_order;
|
||||||
int classcount, count, num_so_far;
|
int classcount, count, num_so_far;
|
||||||
int save_unpaid = 0; /* lint init */
|
|
||||||
long cost, totcost;
|
long cost, totcost;
|
||||||
|
|
||||||
count = count_unpaid(invent);
|
count = count_unpaid(invent);
|
||||||
@@ -1931,14 +1930,12 @@ dounpaid()
|
|||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
marker = (struct obj *) 0;
|
marker = (struct obj *) 0;
|
||||||
otmp = find_unpaid(invent, &marker);
|
otmp = find_unpaid(invent, &marker);
|
||||||
|
cost = unpaid_cost(otmp);
|
||||||
/* see if the unpaid item is in the top level inventory */
|
otmp->unpaid = 0; /* suppress "(unpaid)" suffix */
|
||||||
for (marker = invent; marker; marker = marker->nobj)
|
|
||||||
if (marker == otmp) break;
|
|
||||||
|
|
||||||
pline("%s", xprname(otmp, distant_name(otmp, doname),
|
pline("%s", xprname(otmp, distant_name(otmp, doname),
|
||||||
marker ? otmp->invlet : CONTAINED_SYM,
|
carried(otmp) ? otmp->invlet : CONTAINED_SYM,
|
||||||
TRUE, unpaid_cost(otmp), 0L));
|
TRUE, cost, 0L));
|
||||||
|
otmp->unpaid = 1; /*(wouldn't be here if this wasn't true)*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1959,12 +1956,10 @@ dounpaid()
|
|||||||
}
|
}
|
||||||
|
|
||||||
totcost += cost = unpaid_cost(otmp);
|
totcost += cost = unpaid_cost(otmp);
|
||||||
/* suppress "(unpaid)" suffix */
|
otmp->unpaid = 0; /* suppress "(unpaid)" suffix */
|
||||||
save_unpaid = otmp->unpaid;
|
|
||||||
otmp->unpaid = 0;
|
|
||||||
putstr(win, 0, xprname(otmp, distant_name(otmp, doname),
|
putstr(win, 0, xprname(otmp, distant_name(otmp, doname),
|
||||||
ilet, TRUE, cost, 0L));
|
ilet, TRUE, cost, 0L));
|
||||||
otmp->unpaid = save_unpaid;
|
otmp->unpaid = 1;
|
||||||
num_so_far++;
|
num_so_far++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1982,27 +1977,28 @@ dounpaid()
|
|||||||
*/
|
*/
|
||||||
for (otmp = invent; otmp; otmp = otmp->nobj) {
|
for (otmp = invent; otmp; otmp = otmp->nobj) {
|
||||||
if (Has_contents(otmp)) {
|
if (Has_contents(otmp)) {
|
||||||
long contcost = 0L;
|
long contcost = 0L;
|
||||||
|
|
||||||
marker = (struct obj *) 0; /* haven't found any */
|
marker = (struct obj *) 0; /* haven't found any */
|
||||||
while (find_unpaid(otmp->cobj, &marker)) {
|
while (find_unpaid(otmp->cobj, &marker)) {
|
||||||
totcost += cost = unpaid_cost(marker);
|
totcost += cost = unpaid_cost(marker);
|
||||||
contcost += cost;
|
contcost += cost;
|
||||||
if (otmp->cknown) {
|
if (otmp->cknown) {
|
||||||
save_unpaid = marker->unpaid;
|
marker->unpaid = 0; /* suppress "(unpaid)" suffix */
|
||||||
marker->unpaid = 0; /* suppress "(unpaid)" suffix */
|
|
||||||
putstr(win, 0,
|
putstr(win, 0,
|
||||||
xprname(marker, distant_name(marker, doname),
|
xprname(marker, distant_name(marker, doname),
|
||||||
CONTAINED_SYM, TRUE, cost, 0L));
|
CONTAINED_SYM, TRUE, cost, 0L));
|
||||||
marker->unpaid = save_unpaid;
|
marker->unpaid = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!otmp->cknown) {
|
if (!otmp->cknown) {
|
||||||
char contbuf[BUFSZ];
|
char contbuf[BUFSZ];
|
||||||
/* Shopkeeper knows what to charge for contents */
|
|
||||||
Sprintf(contbuf, "%s contents", s_suffix(xname(otmp)));
|
/* Shopkeeper knows what to charge for contents */
|
||||||
putstr(win, 0,
|
Sprintf(contbuf, "%s contents", s_suffix(xname(otmp)));
|
||||||
xprname((struct obj *)0, contbuf,
|
putstr(win, 0,
|
||||||
CONTAINED_SYM, TRUE, contcost, 0L));
|
xprname((struct obj *)0, contbuf,
|
||||||
|
CONTAINED_SYM, TRUE, contcost, 0L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user