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

Function AIPathMoveToPrevNode

Descent3/aipath.cpp:290–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static bool AIPathMoveToPrevNode(ai_path_info *aip) {
291 int c_path = aip->cur_path;
292 int c_node = aip->cur_node;
293
294 c_node--;
295
296 if (c_node >= 0) {
297 aip->cur_node--;
298 return true;
299 }
300
301 c_path--;
302
303 // We must want to check the next path
304 if (c_path > 0) {
305 aip->cur_path--;
306
307 if (aip->path_type[c_path] == AIP_DYNAMIC) {
308 aip->cur_node = AIDynamicPath[aip->path_id[c_path]].num_nodes - 1;
309 } else if (aip->path_type[c_path] == AIP_STATIC) {
310 aip->cur_node = aip->path_end_node[c_path];
311 }
312 return true;
313 }
314
315 return false;
316}
317
318bool AIPathGetNextNodePos(ai_path_info *aip, vector *pos, int *room) {
319 if (AIPathMoveToNextNode(aip)) {

Callers 3

AIPathGetNextNodePosFunction · 0.85
AIPathGetPrevNodePosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected