From a919b6a5a0f938fac5cff4c55eb5412a60569ec4 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Wed, 6 Nov 2024 21:38:44 -0500 Subject: [PATCH] Fix skipping Adult Ruto one-point cutscene (#4519) * Fix skipping Adult Ruto one-point cutscene * Kill Ruto's actor instead of leaving her to swim up * Change to Story cutscene * Change to extern function --- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 3e1bc9de1..4907edaa2 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -14,6 +14,7 @@ extern "C" { #include "src/overlays/actors/ovl_En_Owl/z_en_owl.h" #include "src/overlays/actors/ovl_En_Ko/z_en_ko.h" #include "src/overlays/actors/ovl_En_Ma1/z_en_ma1.h" +#include "src/overlays/actors/ovl_En_Ru2/z_en_ru2.h" #include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h" #include "src/overlays/actors/ovl_En_Box/z_en_box.h" #include "src/overlays/actors/ovl_Demo_Im/z_demo_im.h" @@ -33,6 +34,8 @@ extern "C" { extern SaveContext gSaveContext; extern PlayState* gPlayState; extern int32_t D_8011D3AC; + +extern void func_80AF36EC(EnRu2* enRu2, PlayState* play); } #define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).GetSelectedOptionIndex() @@ -813,6 +816,15 @@ void TimeSaverOnActorInitHandler(void* actorRef) { Actor_Kill(actor); } } + + // Water Temple Ruto cutscene + if (actor->id == ACTOR_EN_RU2 && gPlayState->sceneNum == SCENE_WATER_TEMPLE) { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { + EnRu2* enRu2 = (EnRu2*)actor; + func_80AF36EC(enRu2, gPlayState); + Actor_Kill(actor); + } + } } void TimeSaverOnSceneInitHandler(int16_t sceneNum) {