extern int dog_nutrition(struct monst *, struct obj *);
extern int dog_eat(struct monst *, struct obj *, coordxy, coordxy, boolean);
extern int dog_move(struct monst *, int);
+extern boolean could_reach_item(struct monst *, coordxy, coordxy);
extern void finish_meating(struct monst *);
extern void quickmimic(struct monst *);
static long score_targ(struct monst *, struct monst *);
static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
coordxy);
-static boolean could_reach_item(struct monst *, coordxy, coordxy);
/* pick a carried item for pet to drop */
struct obj *
}
/* check if a monster could pick up objects from a location */
-static boolean
+boolean
could_reach_item(struct monst *mon, coordxy nx, coordxy ny)
{
if ((!is_pool(nx, ny) || is_swimmer(mon->data))
water location accepts flyers, but they can't reach
underwater objects, so being able to move to a spot
is insufficient for deciding whether to do so */
- if ((is_pool(xx, yy) && !is_swimmer(ptr))
- || (is_lava(xx, yy) && !likes_lava(ptr)))
+ if (!could_reach_item(mtmp, xx, yy))
continue;
/* ignore obj if there's a trap and monster knows it */