equal
deleted
inserted
replaced
178 |
178 |
179 /** Add new node (created by CreateNewNode and filled with data) into open list */ |
179 /** Add new node (created by CreateNewNode and filled with data) into open list */ |
180 FORCEINLINE void AddStartupNode(Node& n) |
180 FORCEINLINE void AddStartupNode(Node& n) |
181 { |
181 { |
182 Yapf().PfNodeCacheFetch(n); |
182 Yapf().PfNodeCacheFetch(n); |
183 m_nodes.InsertOpenNode(n); |
183 // insert the new node only if it is not there |
|
184 if (&m_nodes.FindOpenNode(n.m_key) == NULL) { |
|
185 m_nodes.InsertOpenNode(n); |
|
186 } else { |
|
187 // if we are here, it means that node is already there - how it is possible? |
|
188 // probably the train is in the position that both its ends point to the same tile/exit-dir |
|
189 // very unlikely, but it happened |
|
190 } |
184 } |
191 } |
185 |
192 |
186 /** add multiple nodes - direct children of the given node */ |
193 /** add multiple nodes - direct children of the given node */ |
187 FORCEINLINE void AddMultipleNodes(Node* parent, TileIndex tile, TrackdirBits td_bits) |
194 FORCEINLINE void AddMultipleNodes(Node* parent, TileIndex tile, TrackdirBits td_bits) |
188 { |
195 { |