| 1275 | } |
| 1276 | |
| 1277 | staticfn long |
| 1278 | check_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 | |
| 1296 | staticfn void |
| 1297 | pay(long tmp, struct monst *shkp) |
no test coverage detected