diff options
| author | Philip Dubé <159546+serprex@users.noreply.github.com> | 2026-10-13 03:30:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-13 03:30:45 +0000 |
| commit | 8ccdbb98a0b5bbb89bb67bf62e4219acdac6457b (patch) | |
| tree | 2731dbc3ab0bd0077546a7e4fd8e04a8b28ea0e4 | |
| parent | 5c59f8474ea41848cab3c034f8882a1a366ab622 (diff) | |
stop timer upon lifting triforce, not upon warping to credits (#7385)
| -rw-r--r-- | soh/soh/Enhancements/gameplaystats.cpp | 2 | ||||
| -rw-r--r-- | soh/soh/Enhancements/randomizer/hook_handlers.cpp | 3 | ||||
| -rw-r--r-- | 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 71ae03c92..66d90c74a 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 a49b4dfe9..6d329f823 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<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; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 992089736..6d10ccf77 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<u32>(GAMEPLAYSTAT_TOTAL_TIME); + gSaveContext.ship.stats.gameComplete = 1; GameInteractor_SetTriforceHuntCreditsWarpActive(true); break; case RG_TRIFORCE_PIECE: |
