MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / BNode_UpdatePathInfo

Function BNode_UpdatePathInfo

Descent3/bnode.cpp:182–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180int BNode_PathNumNodes;
181
182static void BNode_UpdatePathInfo(pq_item **node_list, int start, int end) {
183 int cur_node = end;
184 int i;
185
186 BNode_PathNumNodes = 0;
187
188 // mprintf(0, "start crash loop\n");
189 while (cur_node != -1) {
190 BNode_Path[BNode_PathNumNodes++] = cur_node;
191 cur_node = node_list[cur_node]->p_node;
192 }
193 // mprintf(0, "end crash loop\n");
194
195 // Reverse the list (so it is what we want)
196 for (i = 0; i < (BNode_PathNumNodes >> 1); i++) {
197 int temp;
198
199 temp = BNode_Path[i];
200 BNode_Path[i] = BNode_Path[BNode_PathNumNodes - i - 1];
201 BNode_Path[BNode_PathNumNodes - i - 1] = temp;
202 }
203
204 /* for(i = 0; i < BNode_PathNumNodes; i++)
205 {
206 mprintf(0, "Node %d\n", BNode_Path[i]);
207 }
208 */
209}
210
211// Ok to use Highest_room_index offset stuff
212bool BNode_FindPath(int start_room, int i, int j, float rad) {

Callers 1

BNode_FindPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected