| 38 | int AIAltPathNumNodes; |
| 39 | |
| 40 | static 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 |
| 64 | bool AIFindAltPath(object *obj, int i, int j, float *dist) { |