diff options
Diffstat (limited to 'core/math/a_star_grid_2d.cpp')
-rw-r--r-- | core/math/a_star_grid_2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/a_star_grid_2d.cpp b/core/math/a_star_grid_2d.cpp index ad69748452..b1d2f82f9d 100644 --- a/core/math/a_star_grid_2d.cpp +++ b/core/math/a_star_grid_2d.cpp @@ -535,12 +535,12 @@ bool AStarGrid2D::_solve(Point *p_begin_point, Point *p_end_point) { return found_route; } -real_t AStarGrid2D::_estimate_cost(const Vector2i &p_from_id, const Vector2i &p_to_id) { +real_t AStarGrid2D::_estimate_cost(const Vector2i &p_from_id, const Vector2i &p_end_id) { real_t scost; - if (GDVIRTUAL_CALL(_estimate_cost, p_from_id, p_to_id, scost)) { + if (GDVIRTUAL_CALL(_estimate_cost, p_from_id, p_end_id, scost)) { return scost; } - return heuristics[default_estimate_heuristic](p_from_id, p_to_id); + return heuristics[default_estimate_heuristic](p_from_id, p_end_id); } real_t AStarGrid2D::_compute_cost(const Vector2i &p_from_id, const Vector2i &p_to_id) { @@ -729,7 +729,7 @@ void AStarGrid2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id", "allow_partial_path"), &AStarGrid2D::get_point_path, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id", "allow_partial_path"), &AStarGrid2D::get_id_path, DEFVAL(false)); - GDVIRTUAL_BIND(_estimate_cost, "from_id", "to_id") + GDVIRTUAL_BIND(_estimate_cost, "from_id", "end_id") GDVIRTUAL_BIND(_compute_cost, "from_id", "to_id") ADD_PROPERTY(PropertyInfo(Variant::RECT2I, "region"), "set_region", "get_region"); |