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

Function dmonsfree

src/mon.c:2486–2511  ·  view source on GitHub ↗

really free dead monsters */

Source from the content-addressed store, hash-verified

2484
2485/* really free dead monsters */
2486void
2487dmonsfree(void)
2488{
2489 struct monst **mtmp, *freetmp;
2490 int count = 0;
2491 char buf[QBUFSZ];
2492
2493 buf[0] = '\0';
2494 for (mtmp = &fmon; *mtmp; ) {
2495 freetmp = *mtmp;
2496 if (DEADMONSTER(freetmp) && !freetmp->isgd) {
2497 *mtmp = freetmp->nmon;
2498 freetmp->nmon = NULL;
2499 dealloc_monst(freetmp);
2500 count++;
2501 } else
2502 mtmp = &(freetmp->nmon);
2503 }
2504
2505 if (count != iflags.purge_monsters) {
2506 describe_level(buf, 2);
2507 impossible("dmonsfree: %d removed doesn't match %d pending on %s",
2508 count, iflags.purge_monsters, buf);
2509 }
2510 iflags.purge_monsters = 0;
2511}
2512
2513/* called when monster is moved to larger structure */
2514void

Callers 8

savebonesFunction · 0.85
makemap_remove_monsFunction · 0.85
wiz_killFunction · 0.85
movemonFunction · 0.85
makemazFunction · 0.85
savelev_coreFunction · 0.85
freedynamicdataFunction · 0.85
makemap_prepostFunction · 0.85

Calls 3

describe_levelFunction · 0.85
dealloc_monstFunction · 0.70
impossibleFunction · 0.70

Tested by

no test coverage detected