diff options
Diffstat (limited to 'scene/2d/navigation2d.cpp')
-rw-r--r-- | scene/2d/navigation2d.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index bfe5a359f7..383236b4ca 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -646,7 +646,8 @@ debug path break; } - path.push_back(begin_point); + if (path[path.size() - 1].distance_to(begin_point) > CMP_EPSILON) + path.push_back(begin_point); path.invert(); } @@ -763,7 +764,7 @@ Object *Navigation2D::get_closest_point_owner(const Vector2 &p_point) { void Navigation2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("navpoly_create", "mesh:NavigationPolygon", "xform", "owner"), &Navigation2D::navpoly_create, DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("navpoly_create", "mesh", "xform", "owner"), &Navigation2D::navpoly_create, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("navpoly_set_transform", "id", "xform"), &Navigation2D::navpoly_set_transform); ClassDB::bind_method(D_METHOD("navpoly_remove", "id"), &Navigation2D::navpoly_remove); |