Scatter most of Bag of holding contents around. Some items will be destroyed with the same chance as looting a cursed bag. */
| 2515 | /* Scatter most of Bag of holding contents around. Some items will be |
| 2516 | destroyed with the same chance as looting a cursed bag. */ |
| 2517 | staticfn void |
| 2518 | do_boh_explosion(struct obj *boh, boolean on_floor) |
| 2519 | { |
| 2520 | struct obj *otmp, *nobj; |
| 2521 | |
| 2522 | boh->in_use = 1; /* in case scatter() leads to bones creation */ |
| 2523 | for (otmp = boh->cobj; otmp; otmp = nobj) { |
| 2524 | nobj = otmp->nobj; |
| 2525 | if (is_boh_item_gone()) { |
| 2526 | obj_extract_self(otmp); |
| 2527 | mbag_item_gone(!on_floor, otmp, TRUE); |
| 2528 | } else { |
| 2529 | otmp->ox = u.ux, otmp->oy = u.uy; |
| 2530 | (void) scatter(u.ux, u.uy, 4, MAY_HIT | MAY_DESTROY, otmp); |
| 2531 | } |
| 2532 | } |
| 2533 | /* boh is about to be deleted so no need to reset its in_use flag here */ |
| 2534 | } |
| 2535 | |
| 2536 | staticfn long |
| 2537 | boh_loss(struct obj *container, boolean held) |
no test coverage detected