From e9a3114084ce62432f8d1a7e06dd0197fbe7604c Mon Sep 17 00:00:00 2001 From: headshot2017 Date: Thu, 26 Jan 2023 20:17:30 -0400 Subject: [PATCH] fix snoring sfx not stopping on wake up also stops the snoring sound when mario is deleted --- src/decomp/game/mario_actions_stationary.c | 16 ++++++++-------- src/libsm64.c | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/decomp/game/mario_actions_stationary.c b/src/decomp/game/mario_actions_stationary.c index 0f042dd..f46cb04 100644 --- a/src/decomp/game/mario_actions_stationary.c +++ b/src/decomp/game/mario_actions_stationary.c @@ -331,14 +331,14 @@ s32 act_sleeping(struct MarioState *m) { } s32 act_waking_up(struct MarioState *m) { -// if (!m->actionTimer) { -// func_803205E8(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject); -// func_803205E8(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject); -//#ifndef VERSION_JP -// func_803205E8(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject); -//#endif -// raise_background_noise(2); -// } + if (!m->actionTimer) { + stop_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject); + stop_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject); +#ifndef VERSION_JP + stop_sound(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject); +#endif + raise_background_noise(2); + } if (m->input & INPUT_UNKNOWN_10) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); diff --git a/src/libsm64.c b/src/libsm64.c index 0f0603e..f4504f6 100644 --- a/src/libsm64.c +++ b/src/libsm64.c @@ -265,6 +265,8 @@ SM64_LIB_FN void sm64_mario_delete( int32_t marioId ) struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState; global_state_bind( globalState ); + stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject); + free( gMarioObject ); free_area( gCurrentArea );