Conslidate ganon2 hooks (#6432)

This commit is contained in:
Chris
2026-03-28 13:52:55 -04:00
committed by GitHub
parent d1b7edfa7c
commit 1be7533675
2 changed files with 7 additions and 4 deletions

View File

@@ -17,10 +17,10 @@ static void RegisterBossDefeatTimestamps() {
BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_SST, TIMESTAMP_DEFEAT_BONGO_BONGO); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_SST, TIMESTAMP_DEFEAT_BONGO_BONGO);
BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_TW, TIMESTAMP_DEFEAT_TWINROVA); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_TW, TIMESTAMP_DEFEAT_TWINROVA);
BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GANON, TIMESTAMP_DEFEAT_GANONDORF); 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.itemTimestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME;
COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, gSaveContext.ship.stats.gameComplete = true;
[](void* refActor) { gSaveContext.ship.stats.gameComplete = true; }); });
} }
static RegisterShipInitFunc initFunc(RegisterBossDefeatTimestamps); static RegisterShipInitFunc initFunc(RegisterBossDefeatTimestamps);

View File

@@ -225,6 +225,9 @@ class GameInteractor {
static GameInteractionEffectQueryResult RemoveEffect(RemovableGameInteractionEffect& effect); static GameInteractionEffectQueryResult RemoveEffect(RemovableGameInteractionEffect& effect);
// Game Hooks // 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; HOOK_ID nextHookId = 1;
template <typename H> struct RegisteredGameHooks { template <typename H> struct RegisteredGameHooks {