MCPcopy Create free account
hub / github.com/doldecomp/mkdd / findNextPointNo

Method findNextPointNo

src/Sato/ItemFlyTurtle.cpp:732–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730CLPointControllerFlyTurtle::CLPointControllerFlyTurtle() {}
731
732int 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
777void CLPointControllerFlyTurtle::recursiveTargetCalcBack(CLPoint *point, int groupID, int *pPointNo, u8 *pCount, bool *pFoundTarget) {
778 (*pCount)++;

Callers

nothing calls this directly

Calls 9

RCMGetManagerFunction · 0.85
RCMGetKartCheckerFunction · 0.85
GetKartCtrlFunction · 0.85
getRankMethod · 0.80
GetKartCenterPtrMethod · 0.80
getPrevPointNumberMethod · 0.80
getNextPointNumberMethod · 0.80
getKartNumberMethod · 0.45
getGroupIDMethod · 0.45

Tested by

no test coverage detected