| 2673 | } |
| 2674 | |
| 2675 | void |
| 2676 | dealloc_monst(struct monst *mon) |
| 2677 | { |
| 2678 | char buf[QBUFSZ]; |
| 2679 | |
| 2680 | buf[0] = '\0'; |
| 2681 | if (mon->nmon) { |
| 2682 | describe_level(buf, 2); |
| 2683 | panic("dealloc_monst with nmon on %s", buf); |
| 2684 | } |
| 2685 | if (mon->mextra) |
| 2686 | dealloc_mextra(mon); |
| 2687 | /* clear out of date information contained in the about-to-become |
| 2688 | stale memory; see dealloc_obj() */ |
| 2689 | *mon = cg.zeromonst; |
| 2690 | free((genericptr_t) mon); |
| 2691 | } |
| 2692 | |
| 2693 | /* 'mon' is being removed from level due to migration [relmon from keepdogs |
| 2694 | or migrate_to_level] or due to death [m_detach from mondead or mongone] */ |
no test coverage detected