| 278 | } |
| 279 | |
| 280 | const char * |
| 281 | mapfrag_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 | |
| 297 | boolean |
| 298 | mapfrag_match(struct mapfragment *mf, int x, int y) |
no test coverage detected