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

Function mon_in_region

src/region.c:209–218  ·  view source on GitHub ↗

* Check if a monster is inside the region. * It's probably quicker to check with the region internal list * than to check for coordinates. */

Source from the content-addressed store, hash-verified

207 * than to check for coordinates.
208 */
209boolean
210mon_in_region(NhRegion *reg, struct monst *mon)
211{
212 int i;
213
214 for (i = 0; i < reg->n_monst; i++)
215 if (reg->monsters[i] == mon->m_id)
216 return TRUE;
217 return FALSE;
218}
219
220#if 0
221/* not yet used */

Callers 5

add_mon_to_regFunction · 0.85
m_in_out_regionFunction · 0.85
update_monster_regionFunction · 0.85
replace_mon_regionsFunction · 0.85
remove_mon_from_regionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected