diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index 06a711784..f027aa244 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -56,16 +56,17 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), }; -f32 D_80898794[] = { 0.13f, 0.1f, 0.1f }; +static f32 D_80898794[] = { 0.13f, 0.1f, 0.1f }; -Vec3f D_808987A0[] = { 0.0f, 14.0f, 0.0f }; +static Vec3f D_808987A0[] = { 0.0f, 14.0f, 0.0f }; -Vec3f D_808987AC[] = { 0.0f, 8.0f, 0.0f }; +static Vec3f D_808987AC[] = { 0.0f, 8.0f, 0.0f }; extern Gfx D_06000880[]; void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, GlobalContext* globalCtx) { s32 pad; + Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &D_80898764, this->colliderItems); } @@ -104,23 +105,28 @@ void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* } void BgJyaHaheniron_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; BgJyaHaheniron* this = THIS; - Actor_ProcessInitChain(thisx, sInitChain); + + Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, D_80898794[this->actor.params]); - if (thisx->params == 0) { + if (this->actor.params == 0) { BgJyaHaheniron_ColliderInit(this, globalCtx); - thisx->shape.rot.z = (Rand_ZeroOne() * 65535.0f); + this->actor.shape.rot.z = (Rand_ZeroOne() * 65535.0f); BgJyaHaheniron_SetupChairCrumble(this); - } else if (thisx->params == 1) { + } else if (this->actor.params == 1) { BgJyaHaheniron_SetupPillarCrumble(this); - } else if (thisx->params == 2) { + } else if (this->actor.params == 2) { BgJyaHaheniron_SetupRubbleCollide(this); } } void BgJyaHaheniron_Destroy(Actor* thisx, GlobalContext* globalCtx) { - if (thisx->params == 0) { - Collider_DestroyJntSph(globalCtx, &THIS->collider); + s32 pad; + BgJyaHaheniron* this = THIS; + + if (this->actor.params == 0) { + Collider_DestroyJntSph(globalCtx, &this->collider); } } @@ -133,14 +139,14 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx) Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); - if ((this->actor.bgCheckFlags & 9) || - ((this->collider.base.atFlags & 2) && (this->collider.base.at) && (this->collider.base.at->type == 2))) { + if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & 2) && (this->collider.base.at != NULL) && + (this->collider.base.at->type == ACTORTYPE_PLAYER))) { vec.x = -Rand_ZeroOne() * this->actor.velocity.x; vec.y = -Rand_ZeroOne() * this->actor.velocity.y; vec.z = -Rand_ZeroOne() * this->actor.velocity.z; BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, &vec); Actor_Kill(&this->actor); - } else if (this->timer >= 61) { + } else if (this->timer > 60) { Actor_Kill(&this->actor); } else { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); @@ -177,17 +183,20 @@ void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx } void BgJyaHaheniron_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; BgJyaHaheniron* this = THIS; + this->timer++; this->actionFunc(this, globalCtx); } void BgJyaHaheniron_Draw(Actor* thisx, GlobalContext* globalCtx) { static Gfx* dLists[] = { 0x06000880, 0x06000AE0, 0x06000600 }; + s32 pad; BgJyaHaheniron* this = THIS; - if (thisx->params == 0) { + if (this->actor.params == 0) { func_800628A4(0, &this->collider); } - Gfx_DrawDListOpa(globalCtx, dLists[thisx->params]); + Gfx_DrawDListOpa(globalCtx, dLists[this->actor.params]); } |
