diff --git a/src/Pathfinder.cs b/src/Pathfinder.cs index d193d38..e1194c6 100644 --- a/src/Pathfinder.cs +++ b/src/Pathfinder.cs @@ -25,6 +25,10 @@ namespace WorldOfPeacecraft } } PathNode[] result = new PathNode[mapHeight * mapWidth]; + for (int i = 0;i < result.Length;i++) + { + result[i] = new PathNode(); + } int noSteps = findPath (posFrom, posTo, mapWidth, mapHeight, boolMap, result); LinkedList mappedResult = new LinkedList(); for (int i = 0; i < noSteps; i++) {