Have the '$' command include gold in your pack
In verbose mode, the gold in your wallet is totaled separately from that in containers in your pack, and the two are listed separately. In terse mode, just print the total of both. Only known gold is mentioned.
This commit is contained in:
@@ -726,6 +726,7 @@ if a giant carrying a boulder was on ice that melted, it could be killed
|
||||
twice, first by drowning, then by boulder filling the resulting pool
|
||||
when it dropped inventory before being removed from the map
|
||||
allow fire-command to automatically use a polearm, if wielding it
|
||||
make '$' command also count gold carried inside containers
|
||||
|
||||
|
||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||
|
||||
34
src/invent.c
34
src/invent.c
@@ -3722,14 +3722,36 @@ mergable(register struct obj *otmp, register struct obj *obj)
|
||||
int
|
||||
doprgold(void)
|
||||
{
|
||||
/* the messages used to refer to "carrying gold", but that didn't
|
||||
take containers into account */
|
||||
/* Command takes containers into account. */
|
||||
long umoney = money_cnt(g.invent);
|
||||
|
||||
if (!umoney)
|
||||
Your("wallet is empty.");
|
||||
else
|
||||
Your("wallet contains %ld %s.", umoney, currency(umoney));
|
||||
/* Only list the money you know about. Guards and shopkeepers
|
||||
can somehow tell if there is any gold anywhere on your
|
||||
person, but you have no such preternatural gold-sense. */
|
||||
long hmoney = hidden_gold(FALSE);
|
||||
|
||||
if (flags.verbose) {
|
||||
if (!umoney && !hmoney)
|
||||
Your("wallet is empty.");
|
||||
else if (umoney && !hmoney)
|
||||
Your("wallet contains %ld %s.", umoney, currency(umoney));
|
||||
else if (!umoney && hmoney)
|
||||
Your("wallet is empty, but there %s %ld %s stashed away in "
|
||||
"your pack.",
|
||||
(hmoney == 1) ? "is" : "are",
|
||||
hmoney, currency(hmoney));
|
||||
else if (umoney && hmoney)
|
||||
Your("wallet contains %ld %s, and there %s %ld more stashed "
|
||||
"away in your pack.", umoney, currency(umoney),
|
||||
(hmoney == 1) ? "is" : "are",
|
||||
hmoney);
|
||||
} else {
|
||||
long total = umoney + hmoney;
|
||||
if (total)
|
||||
You("are carrying a total of %ld %s.", total, currency(total));
|
||||
else
|
||||
You("have no money.");
|
||||
}
|
||||
shopper_financial_report();
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user