diff options
Diffstat (limited to 'src/pathfinder/yapf/yapf_ship.cpp')
-rw-r--r-- | src/pathfinder/yapf/yapf_ship.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 63abd592e..b880128f5 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -96,7 +96,8 @@ public: /* walk through the path back to the origin */ Node *pPrevNode = NULL; while (pNode->m_parent != NULL) { - if (steps > 1 && --steps < YAPF_SHIP_PATH_CACHE_LENGTH) { + steps--; + if (steps > 0 && steps < YAPF_SHIP_PATH_CACHE_LENGTH) { TrackdirByte td; td = pNode->GetTrackdir(); path_cache.push_front(td); |