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

Function mapfrag_match

src/sp_lev.c:297–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297boolean
298mapfrag_match(struct mapfragment *mf, int x, int y)
299{
300 int rx, ry;
301
302 for (rx = -(mf->wid / 2); rx <= (mf->wid / 2); rx++)
303 for (ry = -(mf->hei / 2); ry <= (mf->hei / 2); ry++) {
304 schar mapc = mapfrag_get(mf, rx + (mf->wid / 2),
305 ry + (mf->hei / 2));
306 schar levc = isok(x+rx, y+ry) ? levl[x+rx][y+ry].typ : STONE;
307
308 if (!match_maptyps(mapc, levc))
309 return FALSE;
310 }
311 return TRUE;
312}
313
314staticfn void
315solidify_map(void)

Callers 2

l_selection_matchFunction · 0.85
lspo_replace_terrainFunction · 0.85

Calls 3

mapfrag_getFunction · 0.85
isokFunction · 0.85
match_maptypsFunction · 0.85

Tested by

no test coverage detected