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

Method IsSPLZClear

src/SB/Game/zNPCSpawner.cpp:621–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621S32 zNPCSpawner::IsSPLZClear(zMovePoint* sp)
622{
623 xVec3 pos_sp;
624 S32 rc;
625 xBound bnd;
626 xVec3 delt;
627
628 memset(&bnd, FALSE, sizeof(xBound));
629
630 bnd.type = 0;
631 xVec3Copy(&pos_sp, zMovePointGetPos(sp));
632
633 bnd.type = 1;
634 bnd.sph.r = 3.5f;
635 xVec3Copy(&bnd.box.center, &pos_sp);
636
637 xQuickCullForBound(&bnd.qcd, &bnd);
638
639 if (g_drawSpawnBounds)
640 {
641 xDrawSetColor(g_CYAN);
642 xBoundDraw(&bnd);
643 }
644
645 if (NPCC_chk_hitPlyr(&bnd, NULL))
646 {
647 return 0;
648 }
649
650 xVec3Sub(&delt, xEntGetPos(&globals.player.ent), &pos_sp);
651
652 if (SQ(delt.x) + SQ(delt.z) < SQ(3.5f))
653 {
654 return 0;
655 }
656
657 return IsNearbyMover(&bnd, TRUE, NULL);
658}
659
660S32 zNPCSpawner::IsNearbyMover(xBound* bnd, S32 usecyl, xCollis* caller_colrec)
661{

Callers

nothing calls this directly

Calls 10

memsetFunction · 0.85
xVec3CopyFunction · 0.85
zMovePointGetPosFunction · 0.85
xDrawSetColorFunction · 0.85
xBoundDrawFunction · 0.85
NPCC_chk_hitPlyrFunction · 0.85
xVec3SubFunction · 0.85
xEntGetPosFunction · 0.85
IsNearbyMoverFunction · 0.85
xQuickCullForBoundFunction · 0.50

Tested by

no test coverage detected