From 9f8b35bd0cea10fbddf2df69c0e171a38d5dc702 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Fri, 2 Oct 2020 22:34:54 -0700 Subject: [PATCH] Ugly match for func_80A7492C --- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 42 ++++++------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 24fed95532..436b92f7a5 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -247,47 +247,26 @@ void func_80A7489C(EnIk* this) { EnIk_SetupAction(this, func_80A7492C); } -#ifdef NON_MATCHING void func_80A7492C(EnIk *this, GlobalContext *globalCtx) { - f32 temp_f0; - f32 temp_f0_2; s16 yawDiff; s32 phi_a0; - s32 absYawDiff; - f32 phi_f2; - s32 absYawDiff_2; - f32 phi_f2_2; + f32 absDist; - phi_a0 = 0x3FFC; - if (this->unk_2FB == 0) { - phi_a0 = 0xAAA; - } + phi_a0 = (this->unk_2FB == 0) ? 0x0AAA : 0x3FFC; yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; - absYawDiff = ABS(yawDiff); - if ((phi_a0 >= absYawDiff) && (this->actor.xzDistFromLink < 100.0f)) { - temp_f0 = this->actor.yDistFromLink; - if (0.0f <= temp_f0) { - phi_f2 = temp_f0; - } else { - phi_f2 = -temp_f0; - } - if (phi_f2 < 150.0f) { - if ((globalCtx->gameplayFrames & 1) != 0) { + if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistFromLink < 100.0f)) { + absDist = ABS(this->actor.yDistFromLink); + if (absDist < 150.0f) { + if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { func_80A751C8(this); } } else { block_13: - absYawDiff_2 = ABS(yawDiff); - if (absYawDiff_2 < 0x4001) { - temp_f0_2 = this->actor.yDistFromLink; - if (0.0f <= temp_f0_2) { - phi_f2_2 = temp_f0_2; - } else { - phi_f2_2 = -temp_f0_2; - } - if (phi_f2_2 < 150.0f) { + if (ABS(yawDiff) < 0x4001) { + absDist = ABS(this->actor.yDistFromLink); + if (absDist < 150.0f) { func_80A74AAC(this); } else { block_21: @@ -303,9 +282,6 @@ block_21: func_80A745E4(this, globalCtx); SkelAnime_FrameUpdateMatrix(&this->skelAnime); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/func_80A7492C.s") -#endif #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/func_80A74AAC.s")