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

Function worm_known

src/worm.c:882–893  ·  view source on GitHub ↗

worm_known() * Is any segment of this worm in viewing range? Note: caller must check * invisibility and telepathy (which should only show the head anyway). * Mostly used in the canseemon() macro. */

Source from the content-addressed store, hash-verified

880 * Mostly used in the canseemon() macro.
881 */
882boolean
883worm_known(struct monst *worm)
884{
885 struct wseg *curr = wtails[worm->wormno];
886
887 while (curr) {
888 if (cansee(curr->wx, curr->wy))
889 return TRUE;
890 curr = curr->nseg;
891 }
892 return FALSE;
893}
894
895/* would moving from <x1,y1> to <x2,y2> involve passing between two
896 consecutive segments of the same worm? */

Callers 2

howmonseenFunction · 0.85
monkilledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected