Fix weird camera state when vanilla c-up cam is interrupted

This commit is contained in:
MysterD 2023-06-03 02:17:53 -07:00
parent 6472b1531a
commit e584a9d3ca
2 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include "engine/graph_node.h" #include "engine/graph_node.h"
#include "level_table.h" #include "level_table.h"
#include "game/hardcoded.h" #include "game/hardcoded.h"
#include "game/sound_init.h"
#include "pc/configfile.h" #include "pc/configfile.h"
#include "pc/network/network.h" #include "pc/network/network.h"
#include "pc/lua/smlua_hooks.h" #include "pc/lua/smlua_hooks.h"
@ -2777,6 +2778,11 @@ s32 mode_c_up_camera(struct Camera *c) {
if (!c) { return 0; } if (!c) { return 0; }
UNUSED u8 unused[12]; UNUSED u8 unused[12];
if (gMarioStates[0].action != ACT_FIRST_PERSON) {
raise_background_noise(2);
set_camera_mode(c, -1, 1);
}
// Play a sound when entering C-Up mode // Play a sound when entering C-Up mode
if (!(sCameraSoundFlags & CAM_SOUND_C_UP_PLAYED)) { if (!(sCameraSoundFlags & CAM_SOUND_C_UP_PLAYED)) {
play_sound_cbutton_up(); play_sound_cbutton_up();

View File

@ -1646,7 +1646,7 @@ void update_mario_inputs(struct MarioState *m) {
} }
if (m->playerIndex == 0) { if (m->playerIndex == 0) {
if (!localIsPaused && gCameraMovementFlags & CAM_MOVE_C_UP_MODE) { if (!localIsPaused && (gCameraMovementFlags & CAM_MOVE_C_UP_MODE)) {
if (m->action & ACT_FLAG_ALLOW_FIRST_PERSON) { if (m->action & ACT_FLAG_ALLOW_FIRST_PERSON) {
m->input |= INPUT_FIRST_PERSON; m->input |= INPUT_FIRST_PERSON;
} else { } else {