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

Method SetCarryState

src/SB/Game/zNPCTypeTiki.cpp:504–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504S32 zNPCTiki::SetCarryState(en_NPC_CARRY_STATE cs)
505{
506 if (this->SelfType() == NPC_TYPE_TIKI_LOVEY)
507 {
508 return 0;
509 }
510
511 switch (cs)
512 {
513 case zNPCCARRY_ATTEMPTPICKUP:
514 if (this->numChildren != 0)
515 {
516 // non-matching: lfs for 0.2f only happens once, should be
517 // showing up multiple times as this gets unrolled
518 for (S32 i = 0; i < 4; i++)
519 {
520 if (this->children[i] != NULL)
521 {
522 if (this->children[i]->bound.box.box.lower.y <
523 0.2f + this->bound.box.box.upper.y)
524 {
525 return 0;
526 }
527 }
528 }
529 return 1;
530 }
531 return 1;
532
533 case zNPCCARRY_PICKUP:
534 this->tikiFlag |= 0x10;
535 this->landHt = FLOAT_MIN;
536 RemoveFromFamily();
537 return 1;
538
539 case zNPCCARRY_NONE:
540 if ((this->tikiFlag & 0x10))
541 {
542 this->tikiFlag &= ~0x10;
543
544 if (this->frame != NULL)
545 {
546 this->frame->mat.up.x = 0.0f;
547 this->frame->mat.up.y = 1.0f;
548 this->frame->mat.up.z = 0.0f;
549 }
550
551 this->model->Mat->up.x = 0.0f;
552 this->model->Mat->up.y = 1.0f;
553 this->model->Mat->up.z = 0.0f;
554
555 if (this->SelfType() == NPC_TYPE_TIKI_STONE)
556 {
557 this->tikiFlag |= 0x25;
558 this->bound.type = XBOUND_TYPE_BOX;
559 }
560 else
561 {

Callers

nothing calls this directly

Calls 3

DamageMethod · 0.95
RemoveFromFamilyFunction · 0.85
SelfTypeMethod · 0.80

Tested by

no test coverage detected