Fix crash in init_level()
This commit is contained in:
parent
f44126f0a4
commit
ca54f774ab
|
@ -1738,7 +1738,7 @@ s32 init_level(void) {
|
|||
if (gCurrDemoInput != NULL) {
|
||||
set_mario_action(gMarioState, ACT_IDLE, 0);
|
||||
} else if (!gDebugLevelSelect) {
|
||||
if (gMarioState->action != ACT_UNINITIALIZED) {
|
||||
if (gMarioState && gMarioState->action != ACT_UNINITIALIZED) {
|
||||
bool skipIntro = (gNetworkType == NT_NONE || gServerSettings.skipIntro != 0);
|
||||
if (gDjuiInMainMenu && (gNetworkType == NT_NONE)) {
|
||||
// pick random main menu level
|
||||
|
@ -1770,7 +1770,7 @@ s32 init_level(void) {
|
|||
play_transition(WARP_TRANSITION_FADE_FROM_STAR, 0x10, 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
|
||||
if (gCurrDemoInput == NULL) {
|
||||
if (gCurrDemoInput == NULL && gCurrentArea) {
|
||||
set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1779,7 +1779,7 @@ s32 init_level(void) {
|
|||
cancel_rumble();
|
||||
}
|
||||
|
||||
if (gMarioState->action == ACT_INTRO_CUTSCENE) {
|
||||
if (gMarioState && gMarioState->action == ACT_INTRO_CUTSCENE) {
|
||||
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_DISABLED_DURING_INTRO_CUTSCENE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue