| 730 | CLPointControllerFlyTurtle::CLPointControllerFlyTurtle() {} |
| 731 | |
| 732 | int CLPointControllerFlyTurtle::findNextPointNo(CLPoint *point) { |
| 733 | int nextPointNo = 0; |
| 734 | int groupID = 0; |
| 735 | for(u8 i = 0; i < RCMGetManager()->getKartNumber(); i++) { |
| 736 | if(RCMGetKartChecker(i)->getRank() == 1) |
| 737 | groupID = GetKartCtrl()->GetKartCenterPtr(i)->getGroupID(); |
| 738 | } |
| 739 | |
| 740 | int pointNo = -1; |
| 741 | u8 cnt = 0; |
| 742 | bool found = false; |
| 743 | |
| 744 | if (point->getPrevPointNumber() > 1) { |
| 745 | bool wasReverse = mIsReverse; |
| 746 | if(!wasReverse) |
| 747 | mIsReverse = true; |
| 748 | |
| 749 | recursiveTargetCalcBack(point, groupID, &pointNo, &cnt, &found); |
| 750 | if(!found && !wasReverse) |
| 751 | mIsReverse = false; |
| 752 | } |
| 753 | |
| 754 | if (!found) { |
| 755 | pointNo = -1; |
| 756 | cnt = 0; |
| 757 | found = false; |
| 758 | if(point->getNextPointNumber() < 2) |
| 759 | return 0; |
| 760 | |
| 761 | bool wasReverse = mIsReverse; |
| 762 | if(wasReverse) |
| 763 | mIsReverse = false; |
| 764 | |
| 765 | recursiveTargetCalc(point, groupID, &pointNo, &cnt, &found); |
| 766 | if(!found && wasReverse) |
| 767 | mIsReverse = true; |
| 768 | } |
| 769 | |
| 770 | if(found && pointNo != -1) |
| 771 | nextPointNo = pointNo; |
| 772 | |
| 773 | return nextPointNo; |
| 774 | |
| 775 | } |
| 776 | |
| 777 | void CLPointControllerFlyTurtle::recursiveTargetCalcBack(CLPoint *point, int groupID, int *pPointNo, u8 *pCount, bool *pFoundTarget) { |
| 778 | (*pCount)++; |
nothing calls this directly
no test coverage detected