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

Function get_iter_mons_xy

src/mon.c:4561–4576  ·  view source on GitHub ↗

iterate all living monsters on current level, calling bfunc for each, passing x,y to the function. if bfunc returns TRUE, stop and return that monster. */

Source from the content-addressed store, hash-verified

4559 passing x,y to the function.
4560 if bfunc returns TRUE, stop and return that monster. */
4561struct monst *
4562get_iter_mons_xy(
4563 boolean (*bfunc)(struct monst *, coordxy, coordxy),
4564 coordxy x, coordxy y)
4565{
4566 struct monst *mtmp, *mtmp2;
4567
4568 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
4569 mtmp2 = mtmp->nmon;
4570 if (DEADMONSTER(mtmp) || mon_offmap(mtmp))
4571 continue;
4572 if ((*bfunc)(mtmp, x, y))
4573 break;
4574 }
4575 return mtmp;
4576}
4577
4578
4579/* Heal the given monster by amt hitpoints, unless it is somehow prevented

Callers 1

kick_doorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected