Add: Road vehicle path cache. (#7261)

This commit is contained in:
PeterN
2019-03-08 23:52:45 +00:00
committed by GitHub
parent dae35188ab
commit 6c6971fb43
9 changed files with 107 additions and 23 deletions

View File

@@ -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);