summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorballoondude2 <55861555+balloondude2@users.noreply.github.com>2026-01-29 19:00:26 -0700
committerGitHub <noreply@github.com>2026-01-29 20:00:26 -0600
commit5bb90c25cef1ec749c923b33be734e13be73fbe7 (patch)
tree69668b178d9c1bc1f31cc2cd3cee3bf169600b56
parentc76014822e483513c0cd7f9e6256a1a80d97acf3 (diff)
Move before moon crash hook (#1521)
-rw-r--r--mm/2s2h/Enhancements/Cycle/MoonCrashSave.cpp2
-rw-r--r--mm/2s2h/Enhancements/Saving/SavingEnhancements.cpp2
-rw-r--r--mm/2s2h/GameInteractor/GameInteractor.cpp4
-rw-r--r--mm/2s2h/GameInteractor/GameInteractor.h2
-rw-r--r--mm/2s2h/GameInteractor/GameInteractor_HookTable.h2
-rw-r--r--mm/src/code/z_parameter.c2
-rw-r--r--mm/src/code/z_sram_NES.c1
7 files changed, 8 insertions, 7 deletions
diff --git a/mm/2s2h/Enhancements/Cycle/MoonCrashSave.cpp b/mm/2s2h/Enhancements/Cycle/MoonCrashSave.cpp
index 58bd00a64..174231f03 100644
--- a/mm/2s2h/Enhancements/Cycle/MoonCrashSave.cpp
+++ b/mm/2s2h/Enhancements/Cycle/MoonCrashSave.cpp
@@ -12,7 +12,7 @@ extern "C" {
#define CVAR CVarGetInteger(CVAR_NAME, 0)
void RegisterMoonCrashSave() {
- COND_HOOK(BeforeMoonCrashSaveReset, CVAR || IS_RANDO, []() {
+ COND_HOOK(BeforeMoonCrash, CVAR || IS_RANDO, []() {
if (CVAR || (IS_RANDO && RANDO_SAVE_OPTIONS[RO_LOGIC] == RO_LOGIC_GLITCHLESS)) {
SavingEnhancements_AdvancePlaytime();
Sram_SaveEndOfCycle(gPlayState);
diff --git a/mm/2s2h/Enhancements/Saving/SavingEnhancements.cpp b/mm/2s2h/Enhancements/Saving/SavingEnhancements.cpp
index f6181ea78..22c9f20d5 100644
--- a/mm/2s2h/Enhancements/Saving/SavingEnhancements.cpp
+++ b/mm/2s2h/Enhancements/Saving/SavingEnhancements.cpp
@@ -223,7 +223,7 @@ static RegisterShipInitFunc registerSavingEnhancements(
SavingEnhancements_AdvancePlaytime();
DeleteOwlSave();
});
- COND_HOOK(BeforeMoonCrashSaveReset, true, []() { DeleteOwlSave(); });
+ COND_HOOK(BeforeMoonCrash, true, []() { DeleteOwlSave(); });
// Vanilla has an arbitrary 2 second delay when saving, we can't remove it entirely because
// it's used to pull off certain 0th Day glitches (specifically Any Item as Any Form and Goron Missile),
diff --git a/mm/2s2h/GameInteractor/GameInteractor.cpp b/mm/2s2h/GameInteractor/GameInteractor.cpp
index f50235adc..f82338128 100644
--- a/mm/2s2h/GameInteractor/GameInteractor.cpp
+++ b/mm/2s2h/GameInteractor/GameInteractor.cpp
@@ -66,8 +66,8 @@ void GameInteractor_ExecuteAfterEndOfCycleSave() {
GameInteractor::Instance->ExecuteHooks<GameInteractor::AfterEndOfCycleSave>();
}
-void GameInteractor_ExecuteBeforeMoonCrashSaveReset() {
- GameInteractor::Instance->ExecuteHooks<GameInteractor::BeforeMoonCrashSaveReset>();
+void GameInteractor_ExecuteBeforeMoonCrash() {
+ GameInteractor::Instance->ExecuteHooks<GameInteractor::BeforeMoonCrash>();
}
void GameInteractor_ExecuteOnInterfaceDrawStart() {
diff --git a/mm/2s2h/GameInteractor/GameInteractor.h b/mm/2s2h/GameInteractor/GameInteractor.h
index 8585c2854..e3c0c1193 100644
--- a/mm/2s2h/GameInteractor/GameInteractor.h
+++ b/mm/2s2h/GameInteractor/GameInteractor.h
@@ -496,7 +496,7 @@ void GameInteractor_ExecuteOnSaveLoad(s16 fileNum);
void GameInteractor_ExecuteOnFileSelectSaveLoad(s16 fileNum, bool isOwlSave, SaveContext* saveContext);
void GameInteractor_ExecuteBeforeEndOfCycleSave();
void GameInteractor_ExecuteAfterEndOfCycleSave();
-void GameInteractor_ExecuteBeforeMoonCrashSaveReset();
+void GameInteractor_ExecuteBeforeMoonCrash();
void GameInteractor_ExecuteOnInterfaceDrawStart();
void GameInteractor_ExecuteAfterInterfaceClockDraw();
void GameInteractor_ExecuteBeforeInterfaceClockDraw();
diff --git a/mm/2s2h/GameInteractor/GameInteractor_HookTable.h b/mm/2s2h/GameInteractor/GameInteractor_HookTable.h
index 3034291c5..29d590a60 100644
--- a/mm/2s2h/GameInteractor/GameInteractor_HookTable.h
+++ b/mm/2s2h/GameInteractor/GameInteractor_HookTable.h
@@ -11,7 +11,7 @@ DEFINE_HOOK(OnSaveLoad, (s16 fileNum))
DEFINE_HOOK(OnFileSelectSaveLoad, (s16 fileNum, bool isOwlSave, SaveContext* saveContext))
DEFINE_HOOK(BeforeEndOfCycleSave, ())
DEFINE_HOOK(AfterEndOfCycleSave, ())
-DEFINE_HOOK(BeforeMoonCrashSaveReset, ())
+DEFINE_HOOK(BeforeMoonCrash, ())
DEFINE_HOOK(OnInterfaceDrawStart, ())
DEFINE_HOOK(AfterInterfaceClockDraw, ())
DEFINE_HOOK(BeforeInterfaceClockDraw, ())
diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c
index 7950c516d..911c319dd 100644
--- a/mm/src/code/z_parameter.c
+++ b/mm/src/code/z_parameter.c
@@ -7992,6 +7992,8 @@ void Interface_DrawPerfectLetters(PlayState* play) {
}
void Interface_StartMoonCrash(PlayState* play) {
+ GameInteractor_ExecuteBeforeMoonCrash();
+
if (play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) {
SEQCMD_DISABLE_PLAY_SEQUENCES(false);
}
diff --git a/mm/src/code/z_sram_NES.c b/mm/src/code/z_sram_NES.c
index bbeb24e70..5d5202500 100644
--- a/mm/src/code/z_sram_NES.c
+++ b/mm/src/code/z_sram_NES.c
@@ -1258,7 +1258,6 @@ void Sram_InitDebugSave(void) {
}
void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
- GameInteractor_ExecuteBeforeMoonCrashSaveReset();
s32 i;
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;