From b9e84ad3b9eac20d56b87fca7a1857c28ed79668 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 1 Sep 2020 23:41:56 -0700 Subject: [PATCH] Shell music only starts and stops for local player --- src/game/interaction.c | 8 ++++---- src/game/mario_actions_submerged.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/game/interaction.c b/src/game/interaction.c index b01764de5..0cf8ac3b8 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -280,7 +280,7 @@ u32 attack_object(struct Object *o, s32 interaction) { void mario_stop_riding_object(struct MarioState *m) { if (m->riddenObj != NULL) { m->riddenObj->oInteractStatus = INT_STATUS_STOP_RIDING; - stop_shell_music(); + if (m->playerIndex == 0) { stop_shell_music(); } m->riddenObj = NULL; } } @@ -297,7 +297,7 @@ void mario_grab_used_object(struct MarioState *m) { void mario_drop_held_object(struct MarioState *m) { if (m->heldObj != NULL) { if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { - stop_shell_music(); + if (m->playerIndex == 0) { stop_shell_music(); } } obj_set_held_state(m->heldObj, bhvCarrySomething4); @@ -318,7 +318,7 @@ void mario_drop_held_object(struct MarioState *m) { void mario_throw_held_object(struct MarioState *m) { if (m->heldObj != NULL) { if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { - stop_shell_music(); + if (m->playerIndex == 0) { stop_shell_music(); } } obj_set_held_state(m->heldObj, bhvCarrySomething5); @@ -1485,7 +1485,7 @@ u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct O attack_object(o, interaction); update_mario_sound_and_camera(m); - play_shell_music(); + if (m->playerIndex == 0) { play_shell_music(); } mario_drop_held_object(m); //! Puts Mario in ground action even when in air, making it easy to diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 1e7229caa..bb6397568 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -754,7 +754,7 @@ static s32 act_water_shell_swimming(struct MarioState *m) { m->heldObj->oInteractStatus = INT_STATUS_STOP_RIDING; m->heldObj = NULL; } - stop_shell_music(); + if (m->playerIndex == 0) { stop_shell_music(); } set_mario_action(m, ACT_FLUTTER_KICK, 0); } @@ -849,7 +849,7 @@ static s32 act_water_punch(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_WATER_PICK_UP_OBJ); if (is_anim_at_end(m)) { if (m->heldObj != NULL && m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { - play_shell_music(); + if (m->playerIndex == 0) { play_shell_music(); } set_mario_action(m, ACT_WATER_SHELL_SWIMMING, 0); } else { set_mario_action(m, ACT_HOLD_WATER_ACTION_END, 1); @@ -1503,7 +1503,7 @@ static s32 check_common_submerged_cancels(struct MarioState *m) { if (m->action == ACT_WATER_SHELL_SWIMMING && m->heldObj != NULL) { m->heldObj->oInteractStatus = INT_STATUS_STOP_RIDING; m->heldObj = NULL; - stop_shell_music(); + if (m->playerIndex == 0) { stop_shell_music(); } } return transition_submerged_to_walking(m);