Parcourir la source

Fix double point in Navigation2D

Fixes #10324.

(cherry picked from commit 71a496803c6c8cd840a88644529f12d93f2603fc)
Pedro J. Estébanez il y a 8 ans
Parent
commit
b64d59f200
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      scene/2d/navigation2d.cpp

+ 2 - 1
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();
 		}