From 7878b8f3e49a5bc57e04b08881966a6d2e162410 Mon Sep 17 00:00:00 2001 From: Rozelette Date: Thu, 13 Oct 2022 08:18:31 -0500 Subject: [PATCH] Fix animation in Ganon that is causing an OOB access during animation (#1764) * Fix animation in Ganon that is causing an OOB access during animation * Fix function args --- soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index ac6b8e62e..46436893d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -577,6 +577,14 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON_ANIME3, false); func_8002DF54(globalCtx, &this->actor, 0x54); this->unk_314 = 3; + + // At this point, the actor has Ganon's skeleton but is still playing an animation for Ganondorf. This + // causes issues when trying to access the limb posotions as Ganon has more limbs than Ganondorf. When + // animating, data from past the end of the animation data is accessed. This is a hack solution so + // that we are at least playing an animation meant for Ganon. There is no visible change since Ganon is + // off-screen. There is actually 1 frame where he is visible, and in the vanilla game he is an + // explosion of limbs since half of them are in random positions from the junk data accessed. + Animation_PlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim); } // fake, tricks the compiler into using stack the way we need it to if (zero) {