Korrekte initialisierung des resultarrays im pathfinding
This commit is contained in:
@@ -25,6 +25,10 @@ namespace WorldOfPeacecraft
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PathNode[] result = new PathNode[mapHeight * mapWidth];
|
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);
|
int noSteps = findPath (posFrom, posTo, mapWidth, mapHeight, boolMap, result);
|
||||||
LinkedList<Coordinate> mappedResult = new LinkedList<Coordinate>();
|
LinkedList<Coordinate> mappedResult = new LinkedList<Coordinate>();
|
||||||
for (int i = 0; i < noSteps; i++) {
|
for (int i = 0; i < noSteps; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user