summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-16 17:08:06 +0200
committerGitHub <noreply@github.com>2017-08-16 17:08:06 +0200
commita8ceb54abf55ddbc3b7148c1d149bf525348aa60 (patch)
treedfc93a5171106ebf9856c659e2120f6dfa26c308
parent5422585db6a2405e5481a2ffbe5c9085b17e0521 (diff)
parent71a496803c6c8cd840a88644529f12d93f2603fc (diff)
Merge pull request #10376 from RandomShaper/fix-nav-double-point
Fix double point in Navigation2D
-rw-r--r--scene/2d/navigation2d.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index e579838903..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();
}