MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / MvptCycle

Method MvptCycle

src/SB/Game/zNPCTypeCommon.cpp:2491–2543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2489}
2490
2491S32 zNPCCommon::MvptCycle()
2492{
2493 zMovePoint* nav_tmp = NULL;
2494
2495 this->spl_mvptspline = NULL;
2496 this->len_mvptspline = 0.0f;
2497 this->dst_curspline = 0.0f;
2498
2499 if (!this->nav_curr)
2500 {
2501 this->GetParm(NPC_PARM_FIRSTMVPT, &this->nav_curr);
2502 nav_tmp = this->nav_curr;
2503 }
2504 else if (this->nav_curr && this->nav_dest)
2505 {
2506 zMovePointGetNext(this->nav_dest, this->nav_curr, &nav_tmp, NULL);
2507 }
2508 else if (this->nav_curr)
2509 {
2510 zMovePointGetNext(this->nav_curr, NULL, &nav_tmp, NULL);
2511 }
2512
2513 if (this->nav_curr)
2514 {
2515 this->nav_past = this->nav_curr;
2516 }
2517
2518 if (this->nav_dest)
2519 {
2520 this->nav_curr = this->nav_dest;
2521 }
2522
2523 this->nav_dest = nav_tmp;
2524
2525 if (this->CanDoSplines() && this->nav_dest && this->nav_dest->HasSpline())
2526 {
2527 this->spl_mvptspline = this->nav_dest->spl;
2528
2529 while (this->nav_dest->asset->bezIndex != 0)
2530 {
2531 this->nav_dest = (zMovePoint*)this->nav_dest->nodes[0];
2532 }
2533
2534 this->len_mvptspline = xSpline3_ArcTotal(this->spl_mvptspline);
2535 }
2536
2537 if (this->nav_dest)
2538 {
2539 zMovePointGetNext(this->nav_dest, this->nav_curr, &this->nav_lead, NULL);
2540 }
2541
2542 return this->nav_dest != NULL ? TRUE : FALSE;
2543}
2544
2545S32 zNPCCommon::HaveLOSToPos(xVec3* pos, F32 dist, xScene* xscn, xBase* tgt, xCollis* colCallers)
2546{

Callers 5

EnterMethod · 0.80
loveyIdleCBFunction · 0.80
ResumeMethod · 0.80
ProcessMethod · 0.80
DoOnArriveStuffMethod · 0.80

Calls 5

GetParmMethod · 0.95
CanDoSplinesMethod · 0.95
xSpline3_ArcTotalFunction · 0.85
HasSplineMethod · 0.80
zMovePointGetNextFunction · 0.70

Tested by

no test coverage detected