MCPcopy Index your code
hub / github.com/NetHack/NetHack / find_mid

Function find_mid

src/light.c:375–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373#define mon_is_local(mon) ((mon)->mx > 0)
374
375struct monst *
376find_mid(unsigned nid, unsigned fmflags)
377{
378 struct monst *mtmp;
379
380 if ((fmflags & FM_YOU) && nid == 1)
381 return &gy.youmonst;
382 if (fmflags & FM_FMON)
383 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
384 if (!DEADMONSTER(mtmp) && mtmp->m_id == nid)
385 return mtmp;
386 if (fmflags & FM_MIGRATE)
387 for (mtmp = gm.migrating_mons; mtmp; mtmp = mtmp->nmon)
388 if (mtmp->m_id == nid)
389 return mtmp;
390 if (fmflags & FM_MYDOGS)
391 for (mtmp = gm.mydogs; mtmp; mtmp = mtmp->nmon)
392 if (mtmp->m_id == nid)
393 return mtmp;
394 return (struct monst *) 0;
395}
396
397staticfn unsigned
398whereis_mon(struct monst *mon, unsigned fmflags)

Callers 8

relink_light_sourcesFunction · 0.85
write_lsFunction · 0.85
doname_baseFunction · 0.85
run_regionsFunction · 0.85
objlist_sanityFunction · 0.85
reviveFunction · 0.85
check_leashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected