# HG changeset patch # User KUDr # Date 1156672243 0 # Node ID a65fe514b429bb772f128a2252774b6657630521 # Parent cae52239a57607c9646813ed8757d054573eb359 (svn r6166) -Fix: [YAPF] fixes one very improbable assert when adding startup node that already exists in the open-list (thanks Panzerfather) diff -r cae52239a576 -r a65fe514b429 yapf/yapf_base.hpp --- a/yapf/yapf_base.hpp Sun Aug 27 09:28:52 2006 +0000 +++ b/yapf/yapf_base.hpp Sun Aug 27 09:50:43 2006 +0000 @@ -180,7 +180,14 @@ FORCEINLINE void AddStartupNode(Node& n) { Yapf().PfNodeCacheFetch(n); - m_nodes.InsertOpenNode(n); + // insert the new node only if it is not there + if (&m_nodes.FindOpenNode(n.m_key) == NULL) { + m_nodes.InsertOpenNode(n); + } else { + // if we are here, it means that node is already there - how it is possible? + // probably the train is in the position that both its ends point to the same tile/exit-dir + // very unlikely, but it happened + } } /** add multiple nodes - direct children of the given node */