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

Function mapfrag_error

src/sp_lev.c:280–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280const char *
281mapfrag_error(struct mapfragment *mf)
282{
283 const char *res = NULL;
284
285 if (!mf) {
286 res = "mapfragment error";
287 } else if (!mapfrag_canmatch(mf)) {
288 mapfrag_free(&mf);
289 res = "mapfragment needs to have odd height and width";
290 } else if (TYP_CANNOT_MATCH(mapfrag_get(mf, mf->wid / 2, mf->hei / 2))) {
291 mapfrag_free(&mf);
292 res = "mapfragment center must be valid terrain";
293 }
294 return res;
295}
296
297boolean
298mapfrag_match(struct mapfragment *mf, int x, int y)

Callers 2

l_selection_matchFunction · 0.85
lspo_replace_terrainFunction · 0.85

Calls 3

mapfrag_canmatchFunction · 0.85
mapfrag_freeFunction · 0.85
mapfrag_getFunction · 0.85

Tested by

no test coverage detected