diff options
| author | Philip Dubé <159546+serprex@users.noreply.github.com> | 2026-04-18 21:21:29 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-18 21:21:29 +0000 |
| commit | 39dcc0a73c561850279be1d6d1ff548cd443ee6d (patch) | |
| tree | 9493090446e57a964683364a1761c84fee5c5df2 | |
| parent | 256ab01630b4d71a64485456e08990a0b6271f22 (diff) | |
Triforce Hunt: drain queue before credits (#6519)
| -rw-r--r-- | soh/soh/Enhancements/randomizer/hook_handlers.cpp | 10 | ||||
| -rw-r--r-- | soh/soh/Enhancements/randomizer/randomizer.cpp | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index ee2aecd55..d6ff0dc5b 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2629,8 +2629,14 @@ void RandomizerOnPlayerUpdateHandler() { } if (!GameInteractor::IsGameplayPaused() && RAND_GET_OPTION(RSK_TRIFORCE_HUNT).IsNot(RO_TRIFORCE_HUNT_OFF)) { - // Warp to credits - if (GameInteractor::State::TriforceHuntCreditsWarpActive) { + // Warp to credits once item queue has drained to avoid losing queued items + if (GameInteractor::State::TriforceHuntCreditsWarpActive && randomizerQueuedChecks.empty() && + randomizerQueuedCheck == RC_UNKNOWN_CHECK) { + gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] = + static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME); + gSaveContext.ship.stats.gameComplete = 1; + Play_PerformSave(gPlayState); + Notification::Emit({ .message = "Game autosaved" }); gPlayState->nextEntranceIndex = ENTR_CHAMBER_OF_THE_SAGES_0; gSaveContext.nextCutsceneIndex = 0xFFF2; gPlayState->transitionTrigger = TRANS_TRIGGER_START; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 924d22ab6..71f88e67d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3902,13 +3902,7 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT) == RO_TRIFORCE_HUNT_WIN) { - gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] = - static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME); - gSaveContext.ship.stats.gameComplete = 1; - Play_PerformSave(play); - Notification::Emit({ - .message = "Game autosaved", - }); + // Save and warp are deferred until item queue drains GameInteractor_SetTriforceHuntCreditsWarpActive(true); } } |
