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

Function count_wsegs

src/worm.c:835–846  ·  view source on GitHub ↗

count_wsegs() * returns the number of segments that a worm has. */

Source from the content-addressed store, hash-verified

833 * returns the number of segments that a worm has.
834 */
835int
836count_wsegs(struct monst *mtmp)
837{
838 int i = 0;
839 struct wseg *curr;
840
841 if (mtmp->wormno) {
842 for (curr = wtails[mtmp->wormno]->nseg; curr; curr = curr->nseg)
843 i++;
844 }
845 return i;
846}
847
848/* create_worm_tail()
849 * will create a worm tail chain of (num_segs + 1) and return pointer to it.

Callers 11

worm_moveFunction · 0.85
worm_nomoveFunction · 0.85
size_wsegFunction · 0.85
digactualholeFunction · 0.85
mon_leaveFunction · 0.85
mm_displacementFunction · 0.85
trapeffect_pitFunction · 0.85
trapeffect_holeFunction · 0.85
trapeffect_webFunction · 0.85
makemonFunction · 0.85
mstatuslineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected