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

Function get_rect

src/rect.c:81–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 */
80
81NhRect *
82get_rect(NhRect *r)
83{
84 NhRect *rectp;
85 int lx, ly, hx, hy;
86 int i;
87
88 lx = r->lx;
89 ly = r->ly;
90 hx = r->hx;
91 hy = r->hy;
92 for (i = 0, rectp = &rect[0]; i < rect_cnt; i++, rectp++)
93 if (lx >= rectp->lx && ly >= rectp->ly && hx <= rectp->hx
94 && hy <= rectp->hy)
95 return rectp;
96 return 0;
97}
98
99/*
100 * Get some random NhRect from the list.

Callers 2

add_rectFunction · 0.85
create_roomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected