check if a monster could pick up objects from a location */
| 1359 | |
| 1360 | /* check if a monster could pick up objects from a location */ |
| 1361 | boolean |
| 1362 | could_reach_item(struct monst *mon, coordxy nx, coordxy ny) |
| 1363 | { |
| 1364 | if ((!is_pool(nx, ny) || is_swimmer(mon->data)) |
| 1365 | && (!is_lava(nx, ny) || likes_lava(mon->data)) |
| 1366 | && (!sobj_at(BOULDER, nx, ny) || throws_rocks(mon->data))) |
| 1367 | return TRUE; |
| 1368 | return FALSE; |
| 1369 | } |
| 1370 | |
| 1371 | /* Hack to prevent a dog from being endlessly stuck near an object that |
| 1372 | * it can't reach, such as caught in a teleport scroll niche. It recursively |
no test coverage detected