From 89fe9c1ccb758b6c5081e4c7c9aece4ffbe3ea06 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Thu, 24 Oct 2024 21:55:17 -0700 Subject: [PATCH] Fix Phantom Ganon fast death time saver crash. (#4476) --- soh/soh/Enhancements/game-interactor/GameInteractor.h | 4 +++- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 2 +- soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 892482e35..6fa2c07c5 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -343,6 +343,7 @@ typedef enum { // Opt: *EnBox VB_GIVE_ITEM_FROM_CHEST, + // Opt: ItemID VB_GIVE_ITEM_FROM_BLUE_WARP, // Opt: *EnItem00 VB_GIVE_ITEM_FROM_ITEM_00, @@ -469,8 +470,9 @@ typedef enum { VB_DEKU_UPDATE_BURNING_DEKU_STICK, /*** Quick Boss Deaths ***/ - // Vanilla condition: true + // Vanilla condition: true; Opt: *BossGanondrof VB_PHANTOM_GANON_DEATH_SCENE, + // Opt: *EnIk VB_NABOORU_KNUCKLE_DEATH_SCENE, /*** Fishsanity ***/ diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index f16f2d44f..3bfd0da6f 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -619,7 +619,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li *should = false; BossGanondrof* pg = va_arg(args, BossGanondrof*); Player* player = GET_PLAYER(gPlayState); - if (pg != nullptr && pg->work[GND_ACTION_STATE] == DEATH_SPASM) { + if (pg->work[GND_ACTION_STATE] == DEATH_SPASM) { // Skip to death scream animation and move ganondrof to middle pg->deathState = DEATH_SCREAM; pg->timers[0] = 50; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 03c3cb292..5f800a056 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -966,7 +966,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { bodyDecayLevel = 1; break; } - if (GameInteractor_Should(VB_PHANTOM_GANON_DEATH_SCENE, true)) { + if (GameInteractor_Should(VB_PHANTOM_GANON_DEATH_SCENE, true, this)) { Math_ApproachS(&this->actor.shape.rot.y, this->work[GND_VARIANCE_TIMER] * -100, 5, 0xBB8); Math_ApproachF(&this->cameraNextEye.z, this->targetPos.z + 60.0f, 0.02f, 0.5f); Math_ApproachF(&this->actor.world.pos.y, GND_BOSSROOM_CENTER_Y + 133.0f, 0.05f, 100.0f);