From 8ccdbb98a0b5bbb89bb67bf62e4219acdac6457b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= <159546+serprex@users.noreply.github.com> Date: Tue, 13 Oct 2026 03:30:45 +0000 Subject: [PATCH] stop timer upon lifting triforce, not upon warping to credits (#7385) --- soh/soh/Enhancements/gameplaystats.cpp | 2 ++ soh/soh/Enhancements/randomizer/hook_handlers.cpp | 3 --- soh/soh/Enhancements/randomizer/randomizer.cpp | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index 71ae03c92d..66d90c74a4 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -293,6 +293,7 @@ void LoadStatsVersion1() { SaveManager::Instance->LoadData("fileCreatedAt", gSaveContext.ship.stats.fileCreatedAt); SaveManager::Instance->LoadData("playTimer", gSaveContext.ship.stats.playTimer); SaveManager::Instance->LoadData("pauseTimer", gSaveContext.ship.stats.pauseTimer); + SaveManager::Instance->LoadData("gameComplete", gSaveContext.ship.stats.gameComplete); SaveManager::Instance->LoadArray( "itemTimestamps", ARRAY_COUNT(gSaveContext.ship.stats.itemTimestamp), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.ship.stats.itemTimestamp[i]); }); @@ -343,6 +344,7 @@ void SaveStats(const SaveContext& saveContext, int sectionID, bool fullSave) { SaveManager::Instance->SaveData("fileCreatedAt", saveContext.ship.stats.fileCreatedAt); SaveManager::Instance->SaveData("playTimer", saveContext.ship.stats.playTimer); SaveManager::Instance->SaveData("pauseTimer", saveContext.ship.stats.pauseTimer); + SaveManager::Instance->SaveData("gameComplete", saveContext.ship.stats.gameComplete); SaveManager::Instance->SaveArray( "itemTimestamps", ARRAY_COUNT(saveContext.ship.stats.itemTimestamp), [&](size_t i) { SaveManager::Instance->SaveData("", saveContext.ship.stats.itemTimestamp[i]); }); diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index a49b4dfe9c..6d329f823d 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2743,9 +2743,6 @@ void RandomizerOnPlayerUpdateHandler() { // 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(GAMEPLAYSTAT_TOTAL_TIME); - gSaveContext.ship.stats.gameComplete = 1; Play_PerformSave(gPlayState); Notification::Emit({ .message = "Game autosaved" }); gPlayState->nextEntranceIndex = ENTR_CHAMBER_OF_THE_SAGES_0; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 9920897368..6d10ccf77e 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1398,6 +1398,9 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { } break; case RG_TRIFORCE: + gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] = + static_cast(GAMEPLAYSTAT_TOTAL_TIME); + gSaveContext.ship.stats.gameComplete = 1; GameInteractor_SetTriforceHuntCreditsWarpActive(true); break; case RG_TRIFORCE_PIECE: