From d3bdd5cee9fd2a19c3ad9980c502a85f1ae5197f Mon Sep 17 00:00:00 2001 From: louist103 Date: Sat, 7 Oct 2023 14:12:40 -0400 Subject: [PATCH 1/3] data --- spec | 1 - .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 50 ++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/spec b/spec index e4508b5bd..f2175b371 100644 --- a/spec +++ b/spec @@ -1551,7 +1551,6 @@ beginseg name "ovl_Obj_Mure2" compress include "build/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.o" - include "build/data/ovl_Obj_Mure2/ovl_Obj_Mure2.data.o" include "build/data/ovl_Obj_Mure2/ovl_Obj_Mure2.reloc.o" endseg diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index bda4dc258..a88c67f7f 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -17,7 +17,11 @@ void func_809613C4(ObjMure2* this, PlayState* play); void func_809613FC(ObjMure2* this, PlayState* play); void func_80961490(ObjMure2* this, PlayState* play); -#if 0 +void func_80960CF0(Vec3f*, Vec3f*); +void func_80960E0C(Vec3f*, Vec3f*); +void func_80960F0C(Vec3f*, Vec3f*); + +#if 1 ActorInit Obj_Mure2_InitVars = { ACTOR_OBJ_MURE2, ACTORCAT_PROP, @@ -30,6 +34,50 @@ ActorInit Obj_Mure2_InitVars = { (ActorFunc)NULL, }; +Vec3f D_80961590 = { +2560000.0, +2560000.0, +2560000.0, +}; + +Vec3f D_8096159C = { +2907025.0, +2907025.0, +2907025.0, +}; + +s16 D_809615A8[] = { +0x0009,0x000C, +0x0008,0x0000, +}; + +s16 D_809615B0[] = { +0x0090,0x0090, +0x00B0,0x0000, +}; + +s16 D_809615B8[] = { +0x0028,0x0666, +0x0028,0x2CCC, +0x0028,0x5999, +0x0028,0x8666, +0x0014,0xC000, +0x0050,0x1333, +0x0050,0x4000, +0x0050,0x6CCC, +0x0050,0x9333, +0x0050,0xACCC, +0x0050,0xC666, +0x003C,0xE000, +}; + +typedef void (*ObjMure2UnkFunc)(Vec3f*, Vec3f*); +ObjMure2UnkFunc D_809615E8[] = { +func_80960CF0, +func_80960E0C, +func_80960F0C, +}; + // static InitChainEntry sInitChain[] = { static InitChainEntry D_809615F4[] = { ICHAIN_F32(uncullZoneForward, 100, ICHAIN_CONTINUE), From eab7aa28b54d764a49352b32b8d41de7a0bc81b0 Mon Sep 17 00:00:00 2001 From: louist103 Date: Sun, 8 Oct 2023 10:12:34 -0400 Subject: [PATCH 2/3] OK --- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 230 ++++++++++++++---- .../actors/ovl_Obj_Mure2/z_obj_mure2.h | 5 +- 2 files changed, 185 insertions(+), 50 deletions(-) diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index a88c67f7f..3e130641f 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -13,13 +13,19 @@ void ObjMure2_Init(Actor* thisx, PlayState* play); void ObjMure2_Update(Actor* thisx, PlayState* play); +void func_8096104C(ObjMure2* this, PlayState* play); void func_809613C4(ObjMure2* this, PlayState* play); void func_809613FC(ObjMure2* this, PlayState* play); void func_80961490(ObjMure2* this, PlayState* play); +void func_809611BC(ObjMure2* this, PlayState* play); +void func_809613B0(ObjMure2* this); +void func_809613E8(ObjMure2* this); +void func_8096147C(ObjMure2* this); +void func_80961018(s16*, ObjMure2*); -void func_80960CF0(Vec3f*, Vec3f*); -void func_80960E0C(Vec3f*, Vec3f*); -void func_80960F0C(Vec3f*, Vec3f*); +void func_80960CF0(Vec3f*, ObjMure2*); +void func_80960E0C(Vec3f*, ObjMure2*); +void func_80960F0C(Vec3f*, ObjMure2*); #if 1 ActorInit Obj_Mure2_InitVars = { @@ -34,48 +40,47 @@ ActorInit Obj_Mure2_InitVars = { (ActorFunc)NULL, }; -Vec3f D_80961590 = { -2560000.0, -2560000.0, -2560000.0, +f32 D_80961590[] = { + 2560000.0, + 2560000.0, + 2560000.0, }; -Vec3f D_8096159C = { -2907025.0, -2907025.0, -2907025.0, +f32 D_8096159C[] = { + 2907025.0, + 2907025.0, + 2907025.0, }; s16 D_809615A8[] = { -0x0009,0x000C, -0x0008,0x0000, + 9, + 12, + 8, + 0, }; s16 D_809615B0[] = { -0x0090,0x0090, -0x00B0,0x0000, + 0x0090, + 0x0090, + 0x00B0, + 0x0000, +}; +typedef struct Mure2SpawnInfo { + s16 dist; + s16 angle; +} Mure2SpawnInfo; + +Mure2SpawnInfo D_809615B8[] = { + { 0x0028, 0x0666 }, { 0x0028, 0x2CCC }, { 0x0028, 0x5999 }, { 0x0028, 0x8666 }, + { 0x0014, 0xC000 }, { 0x0050, 0x1333 }, { 0x0050, 0x4000 }, { 0x0050, 0x6CCC }, + { 0x0050, 0x9333 }, { 0x0050, 0xACCC }, { 0x0050, 0xC666 }, { 0x003C, 0xE000 }, }; -s16 D_809615B8[] = { -0x0028,0x0666, -0x0028,0x2CCC, -0x0028,0x5999, -0x0028,0x8666, -0x0014,0xC000, -0x0050,0x1333, -0x0050,0x4000, -0x0050,0x6CCC, -0x0050,0x9333, -0x0050,0xACCC, -0x0050,0xC666, -0x003C,0xE000, -}; - -typedef void (*ObjMure2UnkFunc)(Vec3f*, Vec3f*); +typedef void (*ObjMure2UnkFunc)(Vec3f*, ObjMure2*); ObjMure2UnkFunc D_809615E8[] = { -func_80960CF0, -func_80960E0C, -func_80960F0C, + func_80960CF0, + func_80960E0C, + func_80960F0C, }; // static InitChainEntry sInitChain[] = { @@ -89,32 +94,159 @@ static InitChainEntry D_809615F4[] = { extern InitChainEntry D_809615F4[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_80960CF0.s") +void func_80960CF0(Vec3f* arg0, ObjMure2* arg1) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_80960E0C.s") + Math_Vec3f_Copy(&arg0[0], &arg1->actor.world.pos); + for (i = 1; i < D_809615A8[arg1->actor.params & 3]; i++) { + Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos); + (arg0 + i)->x += 80.0f * Math_SinS((i - 1) * 0x2000); + (arg0 + i)->z += 80.0f * Math_CosS((i - 1) * 0x2000); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_80960F0C.s") +void func_80960E0C(Vec3f* arg0, ObjMure2* arg1) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_80961018.s") + for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) { + Math_Vec3f_Copy(arg0 + i, &arg1->actor.world.pos); + (arg0 + i)->x += D_809615B8[i].dist * Math_CosS(D_809615B8[i].angle); + (arg0 + i)->z -= D_809615B8[i].dist * Math_SinS(D_809615B8[i].angle); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_8096104C.s") +void func_80960F0C(Vec3f* arg0, ObjMure2* arg1) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809611BC.s") + for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) { + Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos); + (arg0 + i)->x += 80.0f * Math_SinS(i * 0x2000); + (arg0 + i)->z += 80.0f * Math_CosS(i * 0x2000); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809612BC.s") +void func_80961018(s16* arg0, ObjMure2* this) { + s32 temp_v1; + s32 temp_a2; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/ObjMure2_Init.s") + temp_v1 = this->actor.params & 3; + temp_a2 = (this->actor.params >> 8) & 0x1F; + if (temp_v1 == 2) { + *arg0 = temp_a2 << 4; + return; + } + *arg0 = temp_a2 << 8; +} +void func_8096104C(ObjMure2* this, PlayState* play) { + Vec3f* temp_v0; + s32 temp_s0; + Vec3f sp80[12]; + s16 sp7E; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809613B0.s") + temp_s0 = this->actor.params & 3; + D_809615E8[temp_s0](&sp80, this); + func_80961018(&sp7E, this); + for (i = 0; i < D_809615A8[temp_s0]; i++) { + if (this->unk_148[i] != NULL) { + continue; + } + if (((this->unk_178 >> i) & 1) == 0) { + temp_v0 = &sp80[i]; + this->unk_148[i] = Actor_SpawnAsChildAndCutscene( + &play->actorCtx, play, D_809615B0[temp_s0], temp_v0->x, temp_v0->y, temp_v0->z, this->actor.world.rot.x, + 0, this->actor.world.rot.z, sp7E, this->actor.csId, this->actor.halfDaysBits, NULL); + if (this->unk_148[i] != NULL) { + this->unk_148[i]->room = this->actor.room; + } + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809613C4.s") +void func_809611BC(ObjMure2* this, PlayState* play) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809613E8.s") + for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) { + if (((this->unk_178 >> i) & 1) == 0) { + if (this->unk_148[i] != NULL) { + if (Actor_HasParent(this->unk_148[i], play)) { + this->unk_178 |= 1 << i; + } else { + Actor_Kill(this->unk_148[i]); + } + this->unk_148[i] = NULL; + } + } else { + this->unk_148[i] = NULL; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_809613FC.s") +void func_809612BC(ObjMure2* this) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_8096147C.s") + for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) { + if (this->unk_148[i] == NULL) { + continue; + } + if ((((this->unk_178 >> i) & 1) == 0) && (this->unk_148[i]->update == NULL)) { + this->unk_178 |= (1 << i); + this->unk_148[i] = NULL; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/func_80961490.s") +void ObjMure2_Init(Actor* thisx, PlayState* play) { + ObjMure2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mure2/ObjMure2_Update.s") + Actor_ProcessInitChain(&this->actor, D_809615F4); + if (play->csCtx.state != 0) { + this->actor.uncullZoneForward += 1200.0f; + } + func_809613B0(this); +} + +void func_809613B0(ObjMure2* this) { + this->actionFunc = func_809613C4; +} + +void func_809613C4(ObjMure2* this, PlayState* play) { + func_809613E8(this); +} + +void func_809613E8(ObjMure2* this) { + this->actionFunc = func_809613FC; +} + +void func_809613FC(ObjMure2* this, PlayState* play) { + if (Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z) < + D_80961590[this->actor.params & 3] * this->unk_17C) { + this->actor.flags |= 0x10; + func_8096104C(this, play); + func_8096147C(this); + } +} + +void func_8096147C(ObjMure2* this) { + this->actionFunc = func_80961490; +} + +void func_80961490(ObjMure2* this, PlayState* play) { + func_809612BC(this); + if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <= Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) { + this->actor.flags &= ~0x10; + func_809611BC(this, play); + func_809613E8(this); + } +} + +void ObjMure2_Update(Actor* thisx, PlayState* play) { + ObjMure2* this = THIS; + + if (play->csCtx.state == 0) { + this->unk_17C = 1.0f; + } else { + this->unk_17C = 4.0f; + } + this->actionFunc(this, play); +} \ No newline at end of file diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index f70d45f1e..bcdb8e969 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -10,7 +10,10 @@ typedef void (*ObjMure2ActionFunc)(struct ObjMure2*, PlayState*); typedef struct ObjMure2 { /* 0x000 */ Actor actor; /* 0x144 */ ObjMure2ActionFunc actionFunc; - /* 0x148 */ char unk_148[0x38]; + /* 0x148 */ Actor* unk_148[12]; + u16 unk_178; + /* 0x17C */ f32 unk_17C; + } ObjMure2; // size = 0x180 #endif // Z_OBJ_MURE2_H From 7899de4688be3c91772e443db9c5bcaf5dc75043 Mon Sep 17 00:00:00 2001 From: louist103 Date: Mon, 30 Oct 2023 17:31:58 -0400 Subject: [PATCH 3/3] small docs --- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 119 +++++++++--------- .../actors/ovl_Obj_Mure2/z_obj_mure2.h | 4 +- 2 files changed, 59 insertions(+), 64 deletions(-) diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 3e130641f..51302493f 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -23,11 +23,10 @@ void func_809613E8(ObjMure2* this); void func_8096147C(ObjMure2* this); void func_80961018(s16*, ObjMure2*); -void func_80960CF0(Vec3f*, ObjMure2*); -void func_80960E0C(Vec3f*, ObjMure2*); -void func_80960F0C(Vec3f*, ObjMure2*); +void func_80960CF0(Vec3f pos[12], ObjMure2* this); +void func_80960E0C(Vec3f pos[12], ObjMure2* this); +void func_80960F0C(Vec3f pos[12], ObjMure2* this); -#if 1 ActorInit Obj_Mure2_InitVars = { ACTOR_OBJ_MURE2, ACTORCAT_PROP, @@ -52,18 +51,17 @@ f32 D_8096159C[] = { 2907025.0, }; -s16 D_809615A8[] = { +static s16 sChildCounts[] = { 9, 12, 8, 0, }; -s16 D_809615B0[] = { - 0x0090, - 0x0090, - 0x00B0, - 0x0000, +static s16 sActorIds[] = { + ACTOR_EN_KUSA, + ACTOR_EN_KUSA, + ACTOR_EN_ISHI, }; typedef struct Mure2SpawnInfo { s16 dist; @@ -76,52 +74,48 @@ Mure2SpawnInfo D_809615B8[] = { { 0x0050, 0x9333 }, { 0x0050, 0xACCC }, { 0x0050, 0xC666 }, { 0x003C, 0xE000 }, }; -typedef void (*ObjMure2UnkFunc)(Vec3f*, ObjMure2*); -ObjMure2UnkFunc D_809615E8[] = { +typedef void (*ObjMure2SpawnPosFunc)(Vec3f[12], ObjMure2*); +static ObjMure2SpawnPosFunc sSpawnPosFuncs[] = { func_80960CF0, func_80960E0C, func_80960F0C, }; // static InitChainEntry sInitChain[] = { -static InitChainEntry D_809615F4[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 2100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), }; -#endif - -extern InitChainEntry D_809615F4[]; - -void func_80960CF0(Vec3f* arg0, ObjMure2* arg1) { +void func_80960CF0(Vec3f pos[12], ObjMure2* this) { s32 i; - Math_Vec3f_Copy(&arg0[0], &arg1->actor.world.pos); - for (i = 1; i < D_809615A8[arg1->actor.params & 3]; i++) { - Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos); - (arg0 + i)->x += 80.0f * Math_SinS((i - 1) * 0x2000); - (arg0 + i)->z += 80.0f * Math_CosS((i - 1) * 0x2000); + Math_Vec3f_Copy(&pos[0], &this->actor.world.pos); + for (i = 1; i < sChildCounts[this->actor.params & 3]; i++) { + Math_Vec3f_Copy(&pos[i], &this->actor.world.pos); + (pos + i)->x += 80.0f * Math_SinS((i - 1) * 0x2000); + (pos + i)->z += 80.0f * Math_CosS((i - 1) * 0x2000); } } -void func_80960E0C(Vec3f* arg0, ObjMure2* arg1) { +void func_80960E0C(Vec3f pos[12], ObjMure2* this) { s32 i; - for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) { - Math_Vec3f_Copy(arg0 + i, &arg1->actor.world.pos); - (arg0 + i)->x += D_809615B8[i].dist * Math_CosS(D_809615B8[i].angle); - (arg0 + i)->z -= D_809615B8[i].dist * Math_SinS(D_809615B8[i].angle); + for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) { + Math_Vec3f_Copy(pos + i, &this->actor.world.pos); + (pos + i)->x += D_809615B8[i].dist * Math_CosS(D_809615B8[i].angle); + (pos + i)->z -= D_809615B8[i].dist * Math_SinS(D_809615B8[i].angle); } } -void func_80960F0C(Vec3f* arg0, ObjMure2* arg1) { +void func_80960F0C(Vec3f pos[12], ObjMure2* this) { s32 i; - for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) { - Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos); - (arg0 + i)->x += 80.0f * Math_SinS(i * 0x2000); - (arg0 + i)->z += 80.0f * Math_CosS(i * 0x2000); + for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) { + Math_Vec3f_Copy(&pos[i], &this->actor.world.pos); + (pos + i)->x += 80.0f * Math_SinS(i * 0x2000); + (pos + i)->z += 80.0f * Math_CosS(i * 0x2000); } } @@ -138,26 +132,26 @@ void func_80961018(s16* arg0, ObjMure2* this) { *arg0 = temp_a2 << 8; } void func_8096104C(ObjMure2* this, PlayState* play) { - Vec3f* temp_v0; + Vec3f* pos; s32 temp_s0; - Vec3f sp80[12]; + Vec3f spawnPos[12]; s16 sp7E; s32 i; temp_s0 = this->actor.params & 3; - D_809615E8[temp_s0](&sp80, this); + sSpawnPosFuncs[temp_s0](spawnPos, this); func_80961018(&sp7E, this); - for (i = 0; i < D_809615A8[temp_s0]; i++) { - if (this->unk_148[i] != NULL) { + for (i = 0; i < sChildCounts[temp_s0]; i++) { + if (this->actors[i] != NULL) { continue; } - if (((this->unk_178 >> i) & 1) == 0) { - temp_v0 = &sp80[i]; - this->unk_148[i] = Actor_SpawnAsChildAndCutscene( - &play->actorCtx, play, D_809615B0[temp_s0], temp_v0->x, temp_v0->y, temp_v0->z, this->actor.world.rot.x, - 0, this->actor.world.rot.z, sp7E, this->actor.csId, this->actor.halfDaysBits, NULL); - if (this->unk_148[i] != NULL) { - this->unk_148[i]->room = this->actor.room; + if (((this->spawnFlags >> i) & 1) == 0) { + pos = &spawnPos[i]; + this->actors[i] = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, sActorIds[temp_s0], pos->x, pos->y, + pos->z, this->actor.world.rot.x, 0, this->actor.world.rot.z, + sp7E, this->actor.csId, this->actor.halfDaysBits, NULL); + if (this->actors[i] != NULL) { + this->actors[i]->room = this->actor.room; } } } @@ -166,32 +160,32 @@ void func_8096104C(ObjMure2* this, PlayState* play) { void func_809611BC(ObjMure2* this, PlayState* play) { s32 i; - for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) { - if (((this->unk_178 >> i) & 1) == 0) { - if (this->unk_148[i] != NULL) { - if (Actor_HasParent(this->unk_148[i], play)) { - this->unk_178 |= 1 << i; + for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) { + if (((this->spawnFlags >> i) & 1) == 0) { + if (this->actors[i] != NULL) { + if (Actor_HasParent(this->actors[i], play)) { + this->spawnFlags |= 1 << i; } else { - Actor_Kill(this->unk_148[i]); + Actor_Kill(this->actors[i]); } - this->unk_148[i] = NULL; + this->actors[i] = NULL; } } else { - this->unk_148[i] = NULL; + this->actors[i] = NULL; } } } -void func_809612BC(ObjMure2* this) { +void ObjMure2_ClearChildrenList(ObjMure2* this) { s32 i; - for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) { - if (this->unk_148[i] == NULL) { + for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) { + if (this->actors[i] == NULL) { continue; } - if ((((this->unk_178 >> i) & 1) == 0) && (this->unk_148[i]->update == NULL)) { - this->unk_178 |= (1 << i); - this->unk_148[i] = NULL; + if ((((this->spawnFlags >> i) & 1) == 0) && (this->actors[i]->update == NULL)) { + this->spawnFlags |= (1 << i); + this->actors[i] = NULL; } } } @@ -199,7 +193,7 @@ void func_809612BC(ObjMure2* this) { void ObjMure2_Init(Actor* thisx, PlayState* play) { ObjMure2* this = THIS; - Actor_ProcessInitChain(&this->actor, D_809615F4); + Actor_ProcessInitChain(&this->actor, sInitChain); if (play->csCtx.state != 0) { this->actor.uncullZoneForward += 1200.0f; } @@ -232,8 +226,9 @@ void func_8096147C(ObjMure2* this) { } void func_80961490(ObjMure2* this, PlayState* play) { - func_809612BC(this); - if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <= Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) { + ObjMure2_ClearChildrenList(this); + if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <= + Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) { this->actor.flags &= ~0x10; func_809611BC(this, play); func_809613E8(this); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index bcdb8e969..22c4f09e1 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -10,8 +10,8 @@ typedef void (*ObjMure2ActionFunc)(struct ObjMure2*, PlayState*); typedef struct ObjMure2 { /* 0x000 */ Actor actor; /* 0x144 */ ObjMure2ActionFunc actionFunc; - /* 0x148 */ Actor* unk_148[12]; - u16 unk_178; + /* 0x148 */ Actor* actors[12]; + /* 0x178*/ u16 spawnFlags; /* 0x17C */ f32 unk_17C; } ObjMure2; // size = 0x180