MCPcopy Create free account
hub / github.com/NetHack/NetHack / shop_debt

Function shop_debt

src/shk.c:989–999  ·  view source on GitHub ↗

* Figure out how much is owed to a given shopkeeper. * At present, we ignore any amount robbed from the shop, to avoid * turning the `$' command into a way to discover that the current * level is bones data which has a shk on the warpath. */

Source from the content-addressed store, hash-verified

987 * level is bones data which has a shk on the warpath.
988 */
989staticfn long
990shop_debt(struct eshk *eshkp)
991{
992 struct bill_x *bp;
993 int ct;
994 long debt = eshkp->debit;
995
996 for (bp = eshkp->bill_p, ct = eshkp->billct; ct > 0; bp++, ct--)
997 debt += bp->price * bp->bquan;
998 return debt;
999}
1000
1001/* called in response to the `$' command */
1002void

Callers 1

shopper_financial_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected