graphical exception [temporary solution]

performance fixes
minor changes
This commit is contained in:
2016-09-29 21:03:49 +02:00
parent 4f511d907e
commit e75327090d
6 changed files with 46 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ private:
const Grid<Node>& grid;
Dijkstra<Node> dijkstra;
const DijkstraNode<Node>* dnDest;
const DijkstraNode<Node>* dnDest = nullptr;
struct DijkstraAccess {
const Grid<Node>& grid;
@@ -58,9 +58,14 @@ public:
/** get the shortest path from the given start to the configured destination */
DijkstraPath<Node> getShortestPath(const Node& start) {
// destination unknown? -> empty path
if (!dnDest) {return DijkstraPath<Node>();}
const DijkstraNode<Node>* dnStart = dijkstra.getNode(start);
const DijkstraPath<Node> path(dnStart, dnDest);
return path;
}
virtual void updateBefore(WalkState& state, const Node& startNode) override {