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

Function u_have_seen_bounds_selection

src/cmd.c:1212–1242  ·  view source on GitHub ↗

has hero seen all location of the rectangular outline in the selection */

Source from the content-addressed store, hash-verified

1210
1211/* has hero seen all location of the rectangular outline in the selection */
1212staticfn boolean
1213u_have_seen_bounds_selection(struct selectionvar *sel)
1214{
1215 coordxy x, y;
1216 NhRect rect = cg.zeroNhRect;
1217
1218 selection_getbounds(sel, &rect);
1219
1220 for (x = rect.lx; x <= rect.hx; x++) {
1221 y = rect.ly;
1222 if (isok(x,y) && selection_getpoint(x, y, sel)
1223 && glyph_at(x, y) == GLYPH_UNEXPLORED)
1224 return FALSE;
1225 y = rect.hy;
1226 if (isok(x,y) && selection_getpoint(x, y, sel)
1227 && glyph_at(x, y) == GLYPH_UNEXPLORED)
1228 return FALSE;
1229 }
1230 for (y = rect.ly; y <= rect.hy; y++) {
1231 x = rect.lx;
1232 if (isok(x,y) && selection_getpoint(x, y, sel)
1233 && glyph_at(x, y) == GLYPH_UNEXPLORED)
1234 return FALSE;
1235 x = rect.hx;
1236 if (isok(x,y) && selection_getpoint(x, y, sel)
1237 && glyph_at(x, y) == GLYPH_UNEXPLORED)
1238 return FALSE;
1239 }
1240
1241 return TRUE;
1242}
1243
1244/* can hero currently see all locations in the selection */
1245staticfn boolean

Callers 1

lookaround_known_roomFunction · 0.85

Calls 4

selection_getboundsFunction · 0.85
isokFunction · 0.85
selection_getpointFunction · 0.85
glyph_atFunction · 0.85

Tested by

no test coverage detected