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

Function dealloc_monst

src/mon.c:2675–2691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2673}
2674
2675void
2676dealloc_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] */

Callers 5

discard_migrationsFunction · 0.70
dmonsfreeFunction · 0.70
replmonFunction · 0.70
montraitsFunction · 0.70
savemonchnFunction · 0.70

Calls 3

describe_levelFunction · 0.85
dealloc_mextraFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected