From ee628059d836c77ad105a5a4c825d51ee59bf5af Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Sun, 1 Dec 2024 01:59:13 +0000 Subject: [PATCH] Fix Lab Man actor breaking and the invisible UI glitch (#4599) * fix Lab Man actor breaking and the invisible UI glitch * address review --- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 15 +++++++++++++-- soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c | 5 ++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index f59cae9fe..5dce7406f 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -51,6 +51,7 @@ extern "C" { #include "src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h" #include "src/overlays/actors/ovl_En_Xc/z_en_xc.h" #include "src/overlays/actors/ovl_Fishing/z_fishing.h" +#include "src/overlays/actors/ovl_En_Mk/z_en_mk.h" #include "adult_trade_shuffle.h" #include "draw.h" @@ -60,6 +61,7 @@ extern void func_8084DFAC(PlayState* play, Player* player); extern void Player_SetupActionPreserveAnimMovement(PlayState* play, Player* player, PlayerActionFunc actionFunc, s32 flags); extern s32 Player_SetupWaitForPutAway(PlayState* play, Player* player, AfterPutAwayFunc func); extern void Play_InitEnvironment(PlayState * play, s16 skyboxId); +extern void EnMk_Wait(EnMk* enMk, PlayState* play); } #define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).GetContextOptionIndex() @@ -860,7 +862,8 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // This is typically called when you close the text box after getting an item, in case a previous // function hid the interface. - Interface_ChangeAlpha(gSaveContext.unk_13EE); + gSaveContext.unk_13EA = 0; + Interface_ChangeAlpha(0x32); // EnItem00_SetupAction(item00, func_8001E5C8); // *should = false; } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY_GI) { @@ -1399,9 +1402,17 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; } + case VB_TRADE_TIMER_EYEDROPS:{ + EnMk* enMk = va_arg(args, EnMk*); + Flags_SetRandomizerInf(RAND_INF_ADULT_TRADES_LH_TRADE_FROG); + enMk->actor.flags &= ~ACTOR_FLAG_WILL_TALK; + enMk->actionFunc = EnMk_Wait; + enMk->flags |= 1; + *should = false; + break; + } case VB_FREEZE_ON_SKULL_TOKEN: case VB_TRADE_TIMER_ODD_MUSHROOM: - case VB_TRADE_TIMER_EYEDROPS: case VB_TRADE_TIMER_FROG: case VB_ANJU_SET_OBTAINED_TRADE_ITEM: case VB_GIVE_ITEM_FROM_TARGET_IN_WOODS: diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index f5549f86e..4e020f7ec 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -98,9 +98,8 @@ void func_80AACA40(EnMk* this, PlayState* play) { void func_80AACA94(EnMk* this, PlayState* play) { if (Actor_HasParent(&this->actor, play) != 0 || !GameInteractor_Should(VB_TRADE_FROG, true, this)) { this->actor.parent = NULL; - this->actionFunc = func_80AACA40; - Flags_SetRandomizerInf(RAND_INF_ADULT_TRADES_LH_TRADE_FROG); - if (GameInteractor_Should(VB_TRADE_TIMER_EYEDROPS, true)) { + if (GameInteractor_Should(VB_TRADE_TIMER_EYEDROPS, true, this)) { + this->actionFunc = func_80AACA40; func_80088AA0(240); gSaveContext.eventInf[1] &= ~1; }