| 1277 | } |
| 1278 | |
| 1279 | staticfn boolean |
| 1280 | is_ok_location(coordxy x, coordxy y, getloc_flags_t humidity) |
| 1281 | { |
| 1282 | int typ = levl[x][y].typ; |
| 1283 | |
| 1284 | if (Is_waterlevel(&u.uz)) |
| 1285 | return TRUE; /* accept any spot */ |
| 1286 | |
| 1287 | if (is_ok_location_func) |
| 1288 | return is_ok_location_func(x, y); |
| 1289 | |
| 1290 | /* TODO: Should perhaps check if wall is diggable/passwall? */ |
| 1291 | if (humidity & ANY_LOC) |
| 1292 | return TRUE; |
| 1293 | |
| 1294 | if ((humidity & SOLID) && IS_OBSTRUCTED(typ)) |
| 1295 | return TRUE; |
| 1296 | |
| 1297 | if ((humidity & (DRY|SPACELOC)) && SPACE_POS(typ)) { |
| 1298 | boolean bould = (sobj_at(BOULDER, x, y) != NULL); |
| 1299 | |
| 1300 | if (!bould || (bould && (humidity & SOLID))) |
| 1301 | return TRUE; |
| 1302 | } |
| 1303 | if ((humidity & WET) && is_pool(x, y)) |
| 1304 | return TRUE; |
| 1305 | if ((humidity & HOT) && is_lava(x, y)) |
| 1306 | return TRUE; |
| 1307 | return FALSE; |
| 1308 | } |
| 1309 | |
| 1310 | boolean |
| 1311 | pm_good_location(coordxy x, coordxy y, struct permonst *pm) |
no test coverage detected