| 550 | } |
| 551 | |
| 552 | static bool AIPathGetDPathSlot(int *slot, int handle) { |
| 553 | int i; |
| 554 | |
| 555 | for (i = 0; i < MAX_DYNAMIC_PATHS; i++) { |
| 556 | if (!AIDynamicPath[i].use_count) { |
| 557 | AIDynamicPath[i].use_count++; |
| 558 | *slot = i; |
| 559 | AIDynamicPath[i].owner_handle = handle; |
| 560 | return true; |
| 561 | } else if (ObjGet(AIDynamicPath[i].owner_handle) == NULL && AIDynamicPath[i].use_count == 1) { |
| 562 | AIPathFreeDPathSlot(i); |
| 563 | |
| 564 | AIDynamicPath[i].use_count++; |
| 565 | *slot = i; |
| 566 | AIDynamicPath[i].owner_handle = handle; |
| 567 | return true; |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | mprintf(0, "Out of dynamic paths"); |
| 572 | ASSERT(0); // -- get chris |
| 573 | return false; |
| 574 | } |
| 575 | |
| 576 | bool AIPathInitPath(ai_path_info *aip) { |
| 577 | ASSERT(aip); |
no test coverage detected