From 21583cff0b607df58d6fa5aa2e06b0998377e0eb Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 8 Nov 2023 12:18:24 -0800 Subject: [PATCH] Fixed crash in warp_credits --- src/game/level_update.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/level_update.c b/src/game/level_update.c index dc65ea0f..a7c50e22 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -618,7 +618,9 @@ void warp_credits(void) { set_mario_action(gMarioState, marioAction, 0); - reset_camera(gCurrentArea->camera); + if (gCurrentArea) { + reset_camera(gCurrentArea->camera); + } sWarpDest.type = WARP_TYPE_NOT_WARPING; sDelayedWarpOp = WARP_OP_NONE; @@ -626,7 +628,9 @@ void warp_credits(void) { play_transition(WARP_TRANSITION_FADE_FROM_COLOR, 0x14, 0x00, 0x00, 0x00); if (gCurrCreditsEntry == NULL || gCurrCreditsEntry == sCreditsSequence) { - set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0); + if (gCurrentArea) { + set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0); + } } }