From fd94ed3009ab4a3f1016d32c6884b696412ec152 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 6 Feb 2011 15:01:52 +0000 Subject: (svn r21996) -Fix [FS#4472]: [YAPF] Under some circumstances vehicles could be lost --- src/pathfinder/yapf/yapf_base.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pathfinder/yapf') 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(); -- cgit v1.2.3-54-g00ecf