From 24530bfbd6defc5cbc222595590f3ae57813102f Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Mon, 4 Nov 2024 13:43:21 -0500 Subject: [PATCH] Move all checks into update hook --- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 37123d79a..ec29ec456 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -777,11 +777,14 @@ void TimeSaverOnActorInitHandler(void* actorRef) { }); } - if (actor->id == ACTOR_BG_SPOT03_TAKI && Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY) && - (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME || INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY)) { + if (actor->id == ACTOR_BG_SPOT03_TAKI) { bgSpot03UpdateHook = GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id == ACTOR_BG_SPOT03_TAKI && CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0)) { + if (innerActor->id == ACTOR_BG_SPOT03_TAKI && + CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0) && + CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && + (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME || INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY) + ) { BgSpot03Taki* bgSpot03 = static_cast(innerActorRef); if (bgSpot03->actionFunc == func_808ADEF0) { bgSpot03->actionFunc = BgSpot03Taki_KeepOpen;