add weight to astar_path_length's call to astar_path

I think this causes astar_path_length return incorrect length.