diff --git a/src/game/camera.c b/src/game/camera.c index c439b6d26..e759edf4e 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -3252,6 +3252,13 @@ void update_camera(struct Camera *c) { gLakituState.lastFrameAction = sMarioCamState->action; } +void semi_reset_camera(struct Camera* c) { + s16 oldMovementFlags = gCameraMovementFlags; + reset_camera(c); + + // don't cause a reset of position/rotation + gCameraMovementFlags = oldMovementFlags; +} /** * Reset all the camera variables to their arcane defaults */ diff --git a/src/game/camera.h b/src/game/camera.h index 95017afb1..3378c8743 100644 --- a/src/game/camera.h +++ b/src/game/camera.h @@ -687,6 +687,7 @@ void move_mario_head_c_up(UNUSED struct Camera *c); void transition_next_state(UNUSED struct Camera *c, s16 frames); void set_camera_mode(struct Camera *c, s16 mode, s16 frames); void update_camera(struct Camera *c); +void semi_reset_camera(struct Camera* c); void reset_camera(struct Camera *c); void init_camera(struct Camera *c); void select_mario_cam_mode(void); diff --git a/src/game/mario.c b/src/game/mario.c index 21c24098b..fdb216b8b 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -403,7 +403,7 @@ void mario_set_bubbled(struct MarioState* m) { gCutsceneTimer = 0; if (m->playerIndex == 0) { - set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + semi_reset_camera(m->area->camera); } } diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 89f1ba896..c6b36f83d 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -953,7 +953,7 @@ s32 act_bubbled(struct MarioState* m) { m->vel[2] = 0; m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; if (m->playerIndex == 0) { - set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + semi_reset_camera(m->area->camera); } return force_idle_state(m); } diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 045f82ea5..c370d15ac 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -710,7 +710,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { set_mario_action(m, isInWater ? ACT_WATER_IDLE : ACT_IDLE, 0); } if (gServerSettings.stayInLevelAfterStar) { - reset_camera(m->area->camera); + semi_reset_camera(m->area->camera); } } }