Browse Source

Do not allow U-turns while flying. Works fine, but poor representation in
UI

Ivan Savenko 1 year ago
parent
commit
faead7739a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lib/pathfinder/CPathfinder.cpp

+ 3 - 0
lib/pathfinder/CPathfinder.cpp

@@ -136,6 +136,9 @@ void CPathfinder::calculatePaths()
 			if(neighbour->locked)
 				continue;
 
+			if (source.node->theNodeBefore && source.node->theNodeBefore->coord == neighbour->coord )
+				continue; // block U-turns
+
 			if(!hlp->isLayerAvailable(neighbour->layer))
 				continue;