MCPcopy Create free account
hub / github.com/diasurgical/devilution / path_next_node

Function path_next_node

Source/path.cpp:287–306  ·  view source on GitHub ↗

* @brief insert pPath into the frontier (keeping the frontier sorted by total distance) */

Source from the content-addressed store, hash-verified

285 * @brief insert pPath into the frontier (keeping the frontier sorted by total distance)
286 */
287void path_next_node(PATHNODE *pPath)
288{
289 PATHNODE *next, *current;
290 int f;
291
292 next = path_2_nodes;
293 if (!path_2_nodes->NextNode) {
294 path_2_nodes->NextNode = pPath;
295 } else {
296 current = path_2_nodes;
297 next = path_2_nodes->NextNode;
298 f = pPath->f;
299 while (next && next->f < f) {
300 current = next;
301 next = next->NextNode;
302 }
303 pPath->NextNode = next;
304 current->NextNode = pPath;
305 }
306}
307
308/**
309 * @brief update all path costs using depth-first search starting at pPath

Callers 1

path_parent_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected