From 1be7533675660ec7c33fe303d707e8bac486a4ac Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 28 Mar 2026 13:52:55 -0400 Subject: [PATCH] Conslidate ganon2 hooks (#6432) --- .../Enhancements/GameplayStats/BossDefeatTimestamps.cpp | 8 ++++---- soh/soh/Enhancements/game-interactor/GameInteractor.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp index dff3bc912..1cb05814b 100644 --- a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp +++ b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp @@ -17,10 +17,10 @@ static void RegisterBossDefeatTimestamps() { BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_SST, TIMESTAMP_DEFEAT_BONGO_BONGO); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_TW, TIMESTAMP_DEFEAT_TWINROVA); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GANON, TIMESTAMP_DEFEAT_GANONDORF); - BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GANON2, TIMESTAMP_DEFEAT_GANON); - - COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, - [](void* refActor) { gSaveContext.ship.stats.gameComplete = true; }); + COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, [](void* refActor) { + gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME; + gSaveContext.ship.stats.gameComplete = true; + }); } static RegisterShipInitFunc initFunc(RegisterBossDefeatTimestamps); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index bcd84d552..20267760b 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -225,6 +225,9 @@ class GameInteractor { static GameInteractionEffectQueryResult RemoveEffect(RemovableGameInteractionEffect& effect); // Game Hooks + // + // Hooks should be idempotent and execution order is not guaranteed. + // If two operations must happen in a specific order, they should be placed in the same hook. HOOK_ID nextHookId = 1; template struct RegisteredGameHooks {