瀏覽代碼

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

Ivan Savenko 1 年之前
父節點
當前提交
faead7739a
共有 1 個文件被更改,包括 3 次插入0 次删除
  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;