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

Function iter_mons

src/mon.c:4526–4538  ·  view source on GitHub ↗

iterate all living monsters on current level, calling vfunc for each. */

Source from the content-addressed store, hash-verified

4524
4525/* iterate all living monsters on current level, calling vfunc for each. */
4526void
4527iter_mons(void (*vfunc)(struct monst *))
4528{
4529 struct monst *mtmp, *mtmp2;
4530
4531 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
4532 mtmp2 = mtmp->nmon;
4533 if (DEADMONSTER(mtmp) || mon_offmap(mtmp))
4534 continue;
4535 (*vfunc)(mtmp);
4536 }
4537 return;
4538}
4539
4540
4541/* iterate all living monsters on current level, calling bfunc for each.

Callers 12

savebonesFunction · 0.85
final_levelFunction · 0.85
doturnFunction · 0.85
update_mlstmvFunction · 0.85
fprefxFunction · 0.85
set_mimic_blockingFunction · 0.85
mcalcdistressFunction · 0.85
xkilledFunction · 0.85
reschamFunction · 0.85
restartchamFunction · 0.85
pacify_guardsFunction · 0.85
deadbookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected