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

Function get_mon_location

src/zap.c:691–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691boolean
692get_mon_location(
693 struct monst *mon,
694 coordxy *xp, coordxy *yp,
695 int locflags) /* non-zero means get location even if monster is buried */
696{
697 if (mon == &gy.youmonst || (u.usteed && mon == u.usteed)) {
698 *xp = u.ux;
699 *yp = u.uy;
700 return TRUE;
701 } else if (mon->mx > 0 && (!mon->mburied || locflags)) {
702 *xp = mon->mx;
703 *yp = mon->my;
704 return TRUE;
705 } else { /* migrating or buried */
706 *xp = *yp = 0;
707 return FALSE;
708 }
709}
710
711/* used by revive() and animate_statue() */
712struct monst *

Callers 1

do_light_sourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected