From be153b0d2be72352d5144594c36dd88202bd647f Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Thu, 2 Nov 2023 23:48:40 -0600 Subject: [PATCH] Matched func_80C0C364 --- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 22 +++++++++++++++++++++- src/overlays/actors/ovl_En_Bsb/z_en_bsb.h | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 32b63c741..28e5b7729 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -46,8 +46,10 @@ void func_80C0B290(EnBsb* this, s32 arg0); void func_80C0B31C(PlayState* play, EnBsb* this, Vec3f* pos); s32 func_80C0B888(EnBsb* this, PlayState* play); void func_80C0C32C(EnBsb* this); +void func_80C0C430(EnBsb* this); void func_80C0F544(EnBsb* this, Vec3f* pos, Vec3f* unk2, Vec3f* unk3, f32 unk4, s32 unk5); + #if 0 // static ColliderJntSphElementInit sJntSphElementsInit[7] = { static ColliderJntSphElementInit D_80C0F8D4[7] = { @@ -407,7 +409,25 @@ void func_80C0C32C(EnBsb* this) { this->actionFunc = func_80C0C364; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bsb/func_80C0C364.s") +void func_80C0C364(EnBsb* this, PlayState* play) { + f32 sp2C; + s16 sp2A; + s32 var_v1; + + sp2A = this->actor.yawTowardsPlayer; + this->unk_0288 = SubS_GetPathByIndex(play, this->unk_2B6, 0x1F); + func_80C0BC30(this); + if (this->unk_0288 != NULL) { + sp2A = SubS_GetDistSqAndOrientPath(this->unk_0288, this->unk_028C, &this->actor.world.pos, &sp2C); + } + this->actor.world.rot.y -= 0x2EE; + var_v1 = ABS_ALT((s16)(this->actor.world.rot.y - sp2A)); + func_80C0B970(this, play); + if (var_v1 < 0x1000) { + this->unk_2BC = this->actor.world.rot.y; + func_80C0C430(this); + } +} void func_80C0C430(EnBsb* this) { this->unk2A4 = 0; diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h index bcd5b4b4e..0d3374b70 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h @@ -13,7 +13,8 @@ typedef struct EnBsb { /* 0x0188 */ Vec3s unk_188[21]; /* 0x0188 */ Vec3s unk_206[21]; /* 0x0284 */ EnBsbActionFunc actionFunc; - /* 0x0288 */ char unk_288[0x8]; + /* 0x0288 */ Path *unk_0288; + /* 0x028C */ s32 unk_028C; /* 0x0290 */ u8 unk_0290; /* 0x0291 */ char pad_0291[0x3]; /* 0x0294 */ s16 unk294;