Fix bombers code crash.

This commit is contained in:
louist103 2024-01-20 21:36:47 -05:00 committed by Garrett Cox
parent 837ef4dde6
commit f4cae758b5
2 changed files with 10 additions and 11 deletions

View File

@ -237,16 +237,16 @@ void func_809C4BC4(EnBomBowlMan* this, PlayState* play) {
code = gSaveContext.save.saveInfo.bomberCode[i];
if (code == 1) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_809C61A0[i]);
this->unk_2D8[code] = this;
this->unk_2DC[code - 1] = this;
} else {
Math_Vec3f_Copy(&sp7C, &D_809C61A0[i]);
bomBowlMan = (EnBomBowlMan*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_BOM_BOWL_MAN,
sp7C.x, sp7C.y, sp7C.z, 0, this->actor.world.rot.y, 0, code);
if (bomBowlMan != NULL) {
if (i == 2) {
this->unk_2D8[0] = bomBowlMan;
this->unk_2D8 = bomBowlMan;
}
this->unk_2D8[code] = bomBowlMan;
this->unk_2DC[code - 1] = bomBowlMan;
}
}
}
@ -268,7 +268,7 @@ void func_809C4BC4(EnBomBowlMan* this, PlayState* play) {
}
void func_809C4DA4(EnBomBowlMan* this, PlayState* play) {
Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 5000, 0);
Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 0x1388, 0);
if (this->unk_2B8 == 0) {
Player* player = GET_PLAYER(play);
@ -308,7 +308,7 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) {
this->unk_2C0 = 1;
D_809C6104 = 1;
Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csId1)),
&this->unk_2D8[0]->actor);
&this->unk_2D8->actor);
this->unk_2D4 = 0;
this->unk_2BC = 10;
EnBomBowlMan_ChangeAnim(this, ENBOMBOWLMAN_ANIM_17, 1.0f);
@ -537,7 +537,7 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) {
EnBomBowlMan_ChangeAnim(this, ENBOMBOWLMAN_ANIM_18, 1.0f);
}
} else {
Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 2000, 10);
Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 0x7D0, 0xA);
Math_ApproachF(&this->actor.world.pos.x, this->unk_2A0.x, 0.5f, 6.0f);
Math_ApproachF(&this->actor.world.pos.z, this->unk_2A0.z, 0.5f, 6.0f);
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_2A0.x) + SQ(this->actor.world.pos.z - this->unk_2A0.z)) <
@ -642,7 +642,7 @@ void func_809C5BF4(EnBomBowlMan* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Message_CloseTextbox(play);
Camera_SetTargetActor(subCam, &this->unk_2D8[0]->actor);
Camera_SetTargetActor(subCam, &this->unk_2D8->actor);
EnBomBowlMan_ChangeAnim(this, ENBOMBOWLMAN_ANIM_13, 1.0f);
D_809C6100 = 0;
if (player->transformation == PLAYER_FORM_HUMAN) {
@ -656,8 +656,7 @@ void func_809C5BF4(EnBomBowlMan* this, PlayState* play) {
this->actionFunc = func_809C4DA4;
} else {
s32 idx = D_809C6100 - 1;
Camera_SetTargetActor(subCam, &this->unk_2D8[1 + idx]->actor);
Camera_SetTargetActor(subCam, &this->unk_2DC[idx]->actor);
}
}
}

View File

@ -49,8 +49,8 @@ typedef struct EnBomBowlMan {
/* 0x2D2 */ s16 csId2;
/* 0x2D4 */ s16 unk_2D4;
/* 0x2D6 */ s16 csId3;
/* 0x2D8 */ struct EnBomBowlMan* unk_2D8[5];
/* 0x2EC */ UNK_TYPE1 unk2EC[0x4];
/* 0x2D8 */ struct EnBomBowlMan* unk_2D8;
/* 0x2DC */ struct EnBomBowlMan* unk_2DC[5];
/* 0x2F0 */ s16 unk_2F0;
/* 0x2F2 */ s16 unk_2F2;
/* 0x2F4 */ s16 unk_2F4;