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

Function monnear

src/mon.c:2475–2483  ·  view source on GitHub ↗

Is the square close enough for the monster to move or attack into? */

Source from the content-addressed store, hash-verified

2473
2474/* Is the square close enough for the monster to move or attack into? */
2475boolean
2476monnear(struct monst *mon, coordxy x, coordxy y)
2477{
2478 int distance = dist2(mon->mx, mon->my, x, y);
2479
2480 if (distance == 2 && NODIAG(mon->data - mons))
2481 return 0;
2482 return (boolean) (distance < 3);
2483}
2484
2485/* really free dead monsters */
2486void

Callers 15

quest_stat_checkFunction · 0.85
stealFunction · 0.85
passiveFunction · 0.85
new_wereFunction · 0.85
tacticsFunction · 0.85
fightmFunction · 0.85
mattackmFunction · 0.85
thitmonstFunction · 0.85
dog_moveFunction · 0.85
keepdogsFunction · 0.85
newchamFunction · 0.85
distfleeckFunction · 0.85

Calls 1

dist2Function · 0.85

Tested by

no test coverage detected