MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / GetNode2

Function GetNode2

Source/engine/path.cpp:98–107  ·  view source on GitHub ↗

* @brief return a node for this position if it was visited, or NULL if not found */

Source from the content-addressed store, hash-verified

96 * @brief return a node for this position if it was visited, or NULL if not found
97 */
98uint16_t GetNode2(Point targetPosition)
99{
100 uint16_t result = VisitedNodes->nextNodeIndex;
101 while (result != PathNode::InvalidIndex) {
102 if (PathNodes[result].position() == targetPosition)
103 return result;
104 result = PathNodes[result].nextNodeIndex;
105 }
106 return result;
107}
108
109/**
110 * @brief get the next node on the A* frontier to explore (estimated to be closest to the goal), mark it as visited, and return it

Callers 1

ParentPathFunction · 0.85

Calls 1

positionMethod · 0.80

Tested by

no test coverage detected