Avoid crash in mario_delete if audio not init
This commit is contained in:
@@ -271,7 +271,9 @@ SM64_LIB_FN void sm64_mario_delete( int32_t marioId )
|
|||||||
struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState;
|
struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState;
|
||||||
global_state_bind( globalState );
|
global_state_bind( globalState );
|
||||||
|
|
||||||
|
if ( is_audio_initialized ) {
|
||||||
stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
|
stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||||
|
}
|
||||||
|
|
||||||
free( gMarioObject );
|
free( gMarioObject );
|
||||||
free_area( gCurrentArea );
|
free_area( gCurrentArea );
|
||||||
|
|||||||
Reference in New Issue
Block a user