diff options
author | rubidium <rubidium@openttd.org> | 2011-02-06 15:01:52 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-02-06 15:01:52 +0000 |
commit | fd94ed3009ab4a3f1016d32c6884b696412ec152 (patch) | |
tree | 85cf40780ada44c612a1e548f717428965d4a074 | |
parent | 8b2f2c09e54c06d7f8b6417c3feaa7f59ecb9118 (diff) | |
download | openttd-fd94ed3009ab4a3f1016d32c6884b696412ec152.tar.xz |
(svn r21996) -Fix [FS#4472]: [YAPF] Under some circumstances vehicles could be lost
-rw-r--r-- | src/pathfinder/yapf/yapf_base.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pathfinder/yapf/yapf_base.hpp b/src/pathfinder/yapf/yapf_base.hpp index 8c0be560b..42c73a170 100644 --- a/src/pathfinder/yapf/yapf_base.hpp +++ b/src/pathfinder/yapf/yapf_base.hpp @@ -128,6 +128,7 @@ public: #endif /* !NO_DEBUG_MESSAGES */ Yapf().PfSetStartupNodes(); + bool bDestFound = true; while (true) { m_num_steps++; @@ -146,12 +147,12 @@ public: m_nodes.PopOpenNode(n->GetKey()); m_nodes.InsertClosedNode(*n); } else { - m_pBestDestNode = m_pBestIntermediateNode; + bDestFound = false; break; } } - bool bDestFound = (m_pBestDestNode != NULL) && (m_pBestDestNode != m_pBestIntermediateNode); + bDestFound &= (m_pBestDestNode != NULL); #ifndef NO_DEBUG_MESSAGES perf.Stop(); |