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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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_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);

View file

@ -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 <typename H> struct RegisteredGameHooks {