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

Function boh_loss

src/pickup.c:2536–2554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2534}
2535
2536staticfn long
2537boh_loss(struct obj *container, boolean held)
2538{
2539 /* sometimes toss objects if a cursed magic bag */
2540 if (Is_mbag(container) && container->cursed && Has_contents(container)) {
2541 long loss = 0L;
2542 struct obj *curr, *otmp;
2543
2544 for (curr = container->cobj; curr; curr = otmp) {
2545 otmp = curr->nobj;
2546 if (is_boh_item_gone()) {
2547 obj_extract_self(curr);
2548 loss += mbag_item_gone(held, curr, FALSE);
2549 }
2550 }
2551 return loss;
2552 }
2553 return 0;
2554}
2555
2556/* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */
2557staticfn int

Callers 1

use_containerFunction · 0.85

Calls 3

is_boh_item_goneFunction · 0.85
obj_extract_selfFunction · 0.85
mbag_item_goneFunction · 0.85

Tested by

no test coverage detected