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

Function GetNextPath

Source/engine/path.cpp:112–123  ·  view source on GitHub ↗

* @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 */

Source from the content-addressed store, hash-verified

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
111 */
112uint16_t GetNextPath()
113{
114 uint16_t result = Path2Nodes->nextNodeIndex;
115 if (result == PathNode::InvalidIndex) {
116 return result;
117 }
118
119 Path2Nodes->nextNodeIndex = PathNodes[result].nextNodeIndex;
120 PathNodes[result].nextNodeIndex = VisitedNodes->nextNodeIndex;
121 VisitedNodes->nextNodeIndex = result;
122 return result;
123}
124
125/** the number of in-use nodes in path_nodes */
126uint32_t gdwCurNodes;

Callers 1

FindPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected