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

Function check_credit

src/shk.c:1277–1294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1275}
1276
1277staticfn long
1278check_credit(long tmp, struct monst *shkp)
1279{
1280 long credit = ESHK(shkp)->credit;
1281
1282 if (credit == 0L) {
1283 ; /* nothing to do; just 'return tmp;' */
1284 } else if (credit >= tmp) {
1285 pline_The("price is deducted from your credit.");
1286 ESHK(shkp)->credit -= tmp;
1287 tmp = 0L;
1288 } else {
1289 pline_The("price is partially covered by your credit.");
1290 ESHK(shkp)->credit = 0L;
1291 tmp -= credit;
1292 }
1293 return tmp;
1294}
1295
1296staticfn void
1297pay(long tmp, struct monst *shkp)

Callers 3

payFunction · 0.85
stolen_valueFunction · 0.85
pay_for_damageFunction · 0.85

Calls 1

pline_TheFunction · 0.85

Tested by

no test coverage detected