diff options
| author | Philip Dubé <serprex@users.noreply.github.com> | 2026-03-16 21:35:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:35:32 +0000 |
| commit | b15ac97deaed41bc834da6577c92e94f6b99170e (patch) | |
| tree | 42b2dd2c923705c110d0de1ae6aa068c8e5fe032 | |
| parent | 45449623bbf991683f27191940212b9ace83c881 (diff) | |
Fix adult trade items spoiling during file load in rando (#6358)
| -rw-r--r-- | soh/soh/Enhancements/randomizer/hook_handlers.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 440ee1722..cc3c6c81a 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1725,12 +1725,6 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; } - case VB_REVERT_SPOILING_ITEMS: { - if (RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE)) { - *should = false; - } - break; - } case VB_BE_ABLE_TO_PLAY_BOMBCHU_BOWLING: { // Only check for bomb bag when bombchus aren't in logic // and only check for bombchus when bombchus are in logic @@ -2679,6 +2673,13 @@ static void RandomizerRegisterHooks() { static uint32_t onKaleidoUpdateHook = 0; static uint32_t onCuccoOrChickenHatchHook = 0; + // register this outside OnLoadGame as VB is invoked before OnLoadGame + COND_VB_SHOULD(VB_REVERT_SPOILING_ITEMS, true, { + if (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE)) { + *should = false; + } + }); + GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>([](int32_t fileNum) { ShipInit::Init("IS_RANDO"); |
