From 48bfef7d877ab55c34dcb82c555047ea5b62f40e Mon Sep 17 00:00:00 2001 From: djoslin0 Date: Sun, 16 Nov 2025 16:21:29 -0800 Subject: [PATCH] Fix sequenced background music when set in ON_LEVEL_INIT (#1011) --------- Co-authored-by: MysterD --- data/dynos_warps.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/data/dynos_warps.cpp b/data/dynos_warps.cpp index 62273ac96..4e7fd725f 100644 --- a/data/dynos_warps.cpp +++ b/data/dynos_warps.cpp @@ -250,13 +250,10 @@ static void *DynOS_Warp_UpdateWarp(void *aCmd, bool aIsLevelInitDone) { } // Set music - if (sDynosWarpNodeNum == -1 || (sWarpDest.type != WARP_TYPE_SAME_AREA && sWarpDest.type != WARP_TYPE_NOT_WARPING)) { + if ((sWarpDest.type != WARP_TYPE_SAME_AREA && sWarpDest.type != WARP_TYPE_NOT_WARPING)) { if (gCurrentArea != NULL) { set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0); } - if (gMarioState->flags & MARIO_METAL_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.metalCapSequence)); - if (gMarioState->flags & MARIO_VANISH_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.vanishCapSequence)); - if (gMarioState->flags & MARIO_WING_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.wingCapSequence)); if (gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2 || gCurrLevelNum == LEVEL_BOWSER_3) { @@ -264,6 +261,11 @@ static void *DynOS_Warp_UpdateWarp(void *aCmd, bool aIsLevelInitDone) { } } + // Enable power-up cap music + if (gMarioState->flags & MARIO_METAL_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.metalCapSequence)); + if (gMarioState->flags & MARIO_VANISH_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.vanishCapSequence)); + if (gMarioState->flags & MARIO_WING_CAP) play_cap_music(SEQUENCE_ARGS(4, gLevelValues.wingCapSequence)); + // lua hooks smlua_call_event_hooks(HOOK_ON_WARP, sBackupWarpDest.type, sDynosWarpLevelNum, sDynosWarpAreaNum, sDynosWarpNodeNum, sBackupWarpDest.arg);