A 'w' in a map fragment will match any wall (IS_WALL macro):
des.replace_terrain({ mapfragment = "w", toterrain = "F" });
* end of no 'g.'
*/
+#define TYP_CANNOT_MATCH(typ) \
+ ((typ) == MAX_TYPE || (typ) == INVALID_TYPE)
+
/* Does typ match with levl[][].typ, considering special types
MATCH_WALL and MAX_TYPE (aka transparency)? */
static boolean
else if (!mapfrag_canmatch(mf)) {
mapfrag_free(&mf);
return "mapfragment needs to have odd height and width";
- } else if (mapfrag_get(mf, (mf->wid/2), (mf->hei/2)) >= MAX_TYPE) {
+ } else if (TYP_CANNOT_MATCH(mapfrag_get(mf, (mf->wid/2), (mf->hei/2)))) {
mapfrag_free(&mf);
return "mapfragment center must be valid terrain";
}