198 do { |
198 do { |
199 PathFinderInfo->route_extra[i] = parent->node.user_data[0]; |
199 PathFinderInfo->route_extra[i] = parent->node.user_data[0]; |
200 PathFinderInfo->route[i++] = parent->node.tile; |
200 PathFinderInfo->route[i++] = parent->node.tile; |
201 if (i > lengthof(PathFinderInfo->route)) { |
201 if (i > lengthof(PathFinderInfo->route)) { |
202 // We ran out of space for the PathFinder |
202 // We ran out of space for the PathFinder |
203 DEBUG(ai, 0)("[AiPathFinder] Ran out of space in the route[] array!!!"); |
203 DEBUG(ai, 0, "No more space in pathfinder route[] array"); |
204 PathFinderInfo->route_length = -1; // -1 indicates out of space |
204 PathFinderInfo->route_length = -1; // -1 indicates out of space |
205 return; |
205 return; |
206 } |
206 } |
207 parent = parent->parent; |
207 parent = parent->parent; |
208 } while (parent != NULL); |
208 } while (parent != NULL); |
209 PathFinderInfo->route_length = i; |
209 PathFinderInfo->route_length = i; |
210 DEBUG(ai, 1)("[Ai-PathFinding] Found route of %d nodes long in %d nodes of searching", i, Hash_Size(&aystar->ClosedListHash)); |
210 DEBUG(ai, 1, "Found route of %d nodes long in %d nodes of searching", i, Hash_Size(&aystar->ClosedListHash)); |
211 } |
211 } |
212 |
212 |
213 |
213 |
214 // What tiles are around us. |
214 // What tiles are around us. |
215 static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *current) |
215 static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *current) |