From 20ac33d380f273b69beb23828013c1c38ff2087e Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Sat, 2 Nov 2024 12:50:48 -0500 Subject: [PATCH] Fix #4506, Mido crash in intro cutscene with Open Forest (#4511) --- .../TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp | 3 ++- soh/soh/Enhancements/game-interactor/GameInteractor.h | 1 + soh/soh/Enhancements/randomizer/hook_handlers.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp index 78a680175..59381968a 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp @@ -21,7 +21,8 @@ void MoveMidoInKokiriForest_Register() { CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) && (CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD) == EQUIP_VALUE_SHIELD_DEKU) && - (CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_KOKIRI) + (CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_KOKIRI) && + gSaveContext.cutsceneIndex == 0 ) { Flags_SetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD); *should = true; diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index c01af8c4c..15a74b181 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -76,6 +76,7 @@ typedef enum { VB_MIDO_SPAWN, // Opt: *EnMd // Vanilla condition: EnMd->interactInfo.talkState == NPC_TALK_STATE_ACTION + // Note: When overriding this, ensure you're not in the intro cutscene as Mido's path has not been loaded VB_MOVE_MIDO_IN_KOKIRI_FOREST, // Opt: *EnMd // Vanilla condition: CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 7d2c7ebd1..6b474cde1 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -674,7 +674,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; case VB_MOVE_MIDO_IN_KOKIRI_FOREST: - if (RAND_GET_OPTION(RSK_FOREST) == RO_FOREST_OPEN) { + if (RAND_GET_OPTION(RSK_FOREST) == RO_FOREST_OPEN && gSaveContext.cutsceneIndex == 0) { *should = true; } break;