From 851741943034f3d17231e19dfbd5214ab57cbfc6 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 11 Sep 2020 22:32:32 -0700 Subject: [PATCH] Fix first-person camera lock bug Getting kicked in vanilla-cam's first person messed up the camera, this fixes it. Fixes #55 --- src/game/interaction.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/interaction.c b/src/game/interaction.c index 129fa822..63b9141b 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -1263,6 +1263,12 @@ u32 interact_player(struct MarioState* m, UNUSED u32 interactType, struct Object if (m2->playerIndex == 0) { m2->interactObj = m->marioObj; if (interaction & INT_KICK) { + if (m2->action == ACT_FIRST_PERSON) { + // without this branch, the player will be stuck in first person + raise_background_noise(2); + set_camera_mode(m2->area->camera, -1, 1); + m2->input &= ~INPUT_FIRST_PERSON; + } set_mario_action(m2, ACT_FREEFALL, 0); } m->marioObj->oDamageOrCoinValue = determine_player_damage_value(interaction);