Korrekte initialisierung des resultarrays im pathfinding

This commit is contained in:
2014-05-06 11:38:50 +02:00
parent ba6b6c20f7
commit 3cb7c6dbcb

View File

@@ -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<Coordinate> mappedResult = new LinkedList<Coordinate>();
for (int i = 0; i < noSteps; i++) {