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

Function AIUpdatePathInfo

Descent3/aipath.cpp:40–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38int AIAltPathNumNodes;
39
40static void AIUpdatePathInfo(q_item **node_list, int start, int end) {
41 int cur_room = end;
42 int i;
43
44 AIAltPathNumNodes = 0;
45
46 // mprintf(0, "start crash loop\n");
47 while (cur_room != -1) {
48 AIAltPath[AIAltPathNumNodes++] = cur_room;
49 cur_room = node_list[cur_room]->parent;
50 }
51 // mprintf(0, "end crash loop\n");
52
53 // Reverse the list (so it is what we want)
54 for (i = 0; i < (AIAltPathNumNodes >> 1); i++) {
55 int temp;
56
57 temp = AIAltPath[i];
58 AIAltPath[i] = AIAltPath[AIAltPathNumNodes - i - 1];
59 AIAltPath[AIAltPathNumNodes - i - 1] = temp;
60 }
61}
62
63// Ok to use Highest_room_index offset stuff
64bool AIFindAltPath(object *obj, int i, int j, float *dist) {

Callers 1

AIFindAltPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected