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

Function remove_worm

src/worm.c:713–726  ·  view source on GitHub ↗

* remove_worm() * * This function is equivalent to the remove_monster #define in * rm.h, only it will take the worm *and* tail out of the levels array. * It does not get rid of (dealloc) the worm tail structures, and it does * not remove the mon from the fmon chain. */

Source from the content-addressed store, hash-verified

711 * not remove the mon from the fmon chain.
712 */
713void
714remove_worm(struct monst *worm)
715{
716 struct wseg *curr = wtails[worm->wormno];
717
718 while (curr) {
719 if (curr->wx) {
720 remove_monster(curr->wx, curr->wy);
721 newsym(curr->wx, curr->wy);
722 curr->wx = 0;
723 }
724 curr = curr->nseg;
725 }
726}
727
728/*
729 * place_worm_tail_randomly()

Callers 4

rloc_to_coreFunction · 0.85
mdisplacemFunction · 0.85
mon_leaving_levelFunction · 0.85
movebubblesFunction · 0.85

Calls 1

newsymFunction · 0.85

Tested by

no test coverage detected