Verbose reversion follow-up

This commit is contained in:
nhmall
2023-10-29 21:02:47 -04:00
parent 6cbefc7c2d
commit a3f452bbe0
5 changed files with 17 additions and 174 deletions

View File

@@ -2569,10 +2569,19 @@ obj_to_let(struct obj *obj)
void
prinv(const char *prefix, struct obj *obj, long quan)
{
boolean total_of = (quan && (quan < obj->quan));
char totalbuf[QBUFSZ];
if (!prefix)
prefix = "";
pline("%s%s%s", prefix, *prefix ? " " : "",
xprname(obj, (char *) 0, obj_to_let(obj), TRUE, 0L, quan));
totalbuf[0] = '\0';
if (total_of)
Snprintf(totalbuf, sizeof totalbuf,
" (%ld in total).", obj->quan);
pline("%s%s%s%s", prefix, *prefix ? " " : "",
xprname(obj, (char *) 0, obj_to_let(obj), !total_of, 0L, quan),
flags.verbose ? totalbuf : "");
}
DISABLE_WARNING_FORMAT_NONLITERAL