throw away all of a monster's inventory */
| 2522 | |
| 2523 | /* throw away all of a monster's inventory */ |
| 2524 | void |
| 2525 | discard_minvent(struct monst *mtmp, boolean uncreate_artifacts) |
| 2526 | { |
| 2527 | struct obj *otmp; |
| 2528 | |
| 2529 | while ((otmp = mtmp->minvent) != 0) { |
| 2530 | /* this has now become very similar to m_useupall()... */ |
| 2531 | extract_from_minvent(mtmp, otmp, TRUE, TRUE); |
| 2532 | if (uncreate_artifacts && otmp->oartifact) |
| 2533 | artifact_exists(otmp, safe_oname(otmp), FALSE, ONAME_NO_FLAGS); |
| 2534 | obfree(otmp, (struct obj *) 0); /* dealloc_obj() isn't sufficient */ |
| 2535 | } |
| 2536 | } |
| 2537 | |
| 2538 | /* |
| 2539 | * Free obj from whatever list it is on in preparation for deleting it |
no test coverage detected