summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yapf/yapf_ship.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yapf/yapf_ship.cpp b/src/yapf/yapf_ship.cpp
index b612bcf67..0ac6f23d6 100644
--- a/src/yapf/yapf_ship.cpp
+++ b/src/yapf/yapf_ship.cpp
@@ -64,10 +64,10 @@ public:
bool bFound = pf.FindPath(v);
Trackdir next_trackdir = INVALID_TRACKDIR; // this would mean "path not found"
- if (bFound) {
- // path was found
+
+ Node* pNode = pf.GetBestNode();
+ if (pNode != NULL) {
// walk through the path back to the origin
- Node* pNode = pf.GetBestNode();
Node* pPrevNode = NULL;
while (pNode->m_parent != NULL) {
pPrevNode = pNode;