unpaid glob formatting
Make unpaid (shop owned, that is) globs show same weight information as for-sale globs. And don't treat required arguments to globwt() as if they were optional.
This commit is contained in:
+11
-10
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1551138256 2019/02/25 23:44:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.235 $ */
|
/* NetHack 3.6 objnam.c $NHDT-Date: 1558125504 2019/05/17 20:38:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.239 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -910,7 +910,7 @@ unsigned doname_flags;
|
|||||||
vague_quan = (doname_flags & DONAME_VAGUE_QUAN) != 0;
|
vague_quan = (doname_flags & DONAME_VAGUE_QUAN) != 0;
|
||||||
boolean known, dknown, cknown, bknown, lknown;
|
boolean known, dknown, cknown, bknown, lknown;
|
||||||
int omndx = obj->corpsenm;
|
int omndx = obj->corpsenm;
|
||||||
char prefix[PREFIX];
|
char prefix[PREFIX], globbuf[QBUFSZ];
|
||||||
char tmpbuf[PREFIX + 1]; /* for when we have to add something at
|
char tmpbuf[PREFIX + 1]; /* for when we have to add something at
|
||||||
the start of prefix instead of the
|
the start of prefix instead of the
|
||||||
end (Strcat is used on the end) */
|
end (Strcat is used on the end) */
|
||||||
@@ -1208,19 +1208,20 @@ unsigned doname_flags;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* treat 'restoring' like suppress_price because shopkeeper and
|
/* treat 'restoring' like suppress_price because shopkeeper and
|
||||||
bill might not be available yet while restore is in progress */
|
bill might not be available yet while restore is in progress
|
||||||
|
(objects won't normally be formatted during that time, but if
|
||||||
|
'perm_invent' is enabled then they might be) */
|
||||||
if (iflags.suppress_price || restoring) {
|
if (iflags.suppress_price || restoring) {
|
||||||
; /* don't attempt to obtain any stop pricing, even if 'with_price' */
|
; /* don't attempt to obtain any stop pricing, even if 'with_price' */
|
||||||
} else if (is_unpaid(obj)) { /* in inventory or in container in invent */
|
} else if (is_unpaid(obj)) { /* in inventory or in container in invent */
|
||||||
long quotedprice = unpaid_cost(obj, TRUE);
|
long quotedprice = unpaid_cost(obj, TRUE);
|
||||||
|
|
||||||
Sprintf(eos(bp), " (%s, %ld %s)",
|
Sprintf(eos(bp), " (%s, %s%ld %s)",
|
||||||
obj->unpaid ? "unpaid" : "contents",
|
obj->unpaid ? "unpaid" : "contents",
|
||||||
quotedprice, currency(quotedprice));
|
globwt(obj, globbuf), quotedprice, currency(quotedprice));
|
||||||
} else if (with_price) { /* on floor or in container on floor */
|
} else if (with_price) { /* on floor or in container on floor */
|
||||||
int nochrg = 0;
|
int nochrg = 0;
|
||||||
long price = get_cost_of_shop_item(obj, &nochrg);
|
long price = get_cost_of_shop_item(obj, &nochrg);
|
||||||
char globbuf[BUFSZ];
|
|
||||||
|
|
||||||
if (price > 0L)
|
if (price > 0L)
|
||||||
Sprintf(eos(bp), " (%s, %s%ld %s)",
|
Sprintf(eos(bp), " (%s, %s%ld %s)",
|
||||||
@@ -4207,11 +4208,11 @@ globwt(otmp, buf)
|
|||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
char *buf;
|
char *buf;
|
||||||
{
|
{
|
||||||
if (otmp && buf && otmp->globby && otmp->quan == 1L) {
|
*buf = '\0';
|
||||||
Sprintf(buf, "%d aum, ", (int) otmp->owt);
|
if (otmp->globby) {
|
||||||
return buf;
|
Sprintf(buf, "%u aum, ", otmp->owt);
|
||||||
}
|
}
|
||||||
return "";
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*objnam.c*/
|
/*objnam.c*/
|
||||||
|
|||||||
Reference in New Issue
Block a user