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 d73d8e97bd
commit c07c80f5ef
2 changed files with 7 additions and 1 deletions

View file

@ -29,6 +29,7 @@
#include "engine/graph_node.h"
#include "level_table.h"
#include "game/hardcoded.h"
#include "game/sound_init.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
#include "pc/lua/smlua_hooks.h"
@ -2777,6 +2778,11 @@ s32 mode_c_up_camera(struct Camera *c) {
if (!c) { return 0; }
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
if (!(sCameraSoundFlags & CAM_SOUND_C_UP_PLAYED)) {
play_sound_cbutton_up();

View file

@ -1646,7 +1646,7 @@ void update_mario_inputs(struct MarioState *m) {
}
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) {
m->input |= INPUT_FIRST_PERSON;
} else {