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

Function xEntCollCheckOneEntNoDepen

src/SB/Core/x/xEnt.cpp:1502–1631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1500
1501S32 xent_entent = 0;
1502xEnt* xEntCollCheckOneEntNoDepen(xEnt* ent, xScene* sc, void* data)
1503{
1504 xent_entent = 1;
1505
1506 xEnt* p = (xEnt*)data;
1507 xCollis* coll;
1508 U32 modl_coll = 0;
1509
1510 if (p->collis->idx >= 15)
1511 {
1512 xent_entent = 0;
1513 return NULL;
1514 }
1515
1516 if ((ent->chkby & p->collType) == 0)
1517 {
1518 xent_entent = 0;
1519 return ent;
1520 }
1521
1522 if (ent->id == p->id && (ent == p || ent->baseType != eBaseTypeBoulder))
1523 {
1524 xent_entent = 0;
1525 return ent;
1526 }
1527
1528 coll = &p->collis->colls[p->collis->idx];
1529
1530 if (ent->collLev == 5 && p->collType & (XENT_COLLTYPE_NPC | XENT_COLLTYPE_PLYR))
1531 {
1532 modl_coll = 1;
1533 }
1534
1535 if (modl_coll)
1536 {
1537 coll->flags = 0;
1538 }
1539 else
1540 {
1541 coll->flags = 0x1F00;
1542 }
1543
1544 xBoundHitsBound(&p->bound, &ent->bound, coll);
1545
1546 if (coll->flags & 0x1)
1547 {
1548 if (modl_coll)
1549 {
1550 xBound tmp;
1551 xBound* bptr; // unused
1552 U8 ncolls;
1553 xVec3 *upper, *lower;
1554 U8 idx;
1555
1556 coll->flags = 0x1F00;
1557
1558 if (p->bound.type == XBOUND_TYPE_SPHERE)
1559 {

Callers

nothing calls this directly

Calls 5

xBoundHitsBoundFunction · 0.85
xVec3AddFunction · 0.85
xVec3SMulByFunction · 0.85
xsqrtFunction · 0.85
iSphereHitsModel3Function · 0.50

Tested by

no test coverage detected