an object inside a cursed bag of holding is being destroyed */
| 2800 | |
| 2801 | /* an object inside a cursed bag of holding is being destroyed */ |
| 2802 | staticfn long |
| 2803 | mbag_item_gone(boolean held, struct obj *item, boolean silent) |
| 2804 | { |
| 2805 | struct monst *shkp; |
| 2806 | long loss = 0L; |
| 2807 | |
| 2808 | if (!silent) { |
| 2809 | if (item->dknown) |
| 2810 | pline("%s %s vanished!", Doname2(item), otense(item, "have")); |
| 2811 | else |
| 2812 | You("%s %s disappear!", Blind ? "notice" : "see", doname(item)); |
| 2813 | } |
| 2814 | |
| 2815 | if (*u.ushops && (shkp = shop_keeper(*u.ushops)) != 0) { |
| 2816 | if (held ? (boolean) item->unpaid : costly_spot(u.ux, u.uy)) |
| 2817 | loss = stolen_value(item, u.ux, u.uy, (boolean) shkp->mpeaceful, |
| 2818 | TRUE); |
| 2819 | } |
| 2820 | obfree(item, (struct obj *) 0); |
| 2821 | return loss; |
| 2822 | } |
| 2823 | |
| 2824 | /* used for #loot/apply, #tip, and final disclosure */ |
| 2825 | void |
no test coverage detected