pathfinding: check if target is actually reachable before going there