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

Function inside_region

src/region.c:62–73  ·  view source on GitHub ↗

* Check if a point is inside a region. */

Source from the content-addressed store, hash-verified

60 * Check if a point is inside a region.
61 */
62boolean
63inside_region(NhRegion *reg, int x, int y)
64{
65 int i;
66
67 if (reg == (NhRegion *) 0 || !inside_rect(&(reg->bounding_box), x, y))
68 return FALSE;
69 for (i = 0; i < reg->nrects; i++)
70 if (inside_rect(&(reg->rects[i]), x, y))
71 return TRUE;
72 return FALSE;
73}
74
75/*
76 * Create a region. It does not activate it.

Callers 8

add_regionFunction · 0.85
remove_regionFunction · 0.85
in_out_regionFunction · 0.85
m_in_out_regionFunction · 0.85
update_player_regionsFunction · 0.85
update_monster_regionFunction · 0.85
visible_region_atFunction · 0.85
expire_gas_cloudFunction · 0.85

Calls 1

inside_rectFunction · 0.85

Tested by

no test coverage detected