From 026c2fe550494061e89d9b2ce2fccb51d4522dbb Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:23:22 -0500 Subject: [PATCH] Make flying use first person pitch --- src/game/mario_actions_airborne.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index 66d6fb2e..2200d6e5 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -21,6 +21,7 @@ #include "pc/network/network.h" #include "pc/lua/smlua.h" #include "hardcoded.h" +#include "first_person_cam.h" void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) { if (!m) { return; } @@ -326,6 +327,10 @@ void update_flying_yaw(struct MarioState *m) { void update_flying_pitch(struct MarioState *m) { if (!m) { return; } s16 targetPitchVel = -(s16)(m->controller->stickY * (m->forwardVel / 5.0f)); + if (get_first_person_enabled()) { + f32 mag = ((f32)gFirstPersonCamera.pitch / 0x3F00) * 64; + targetPitchVel = -(s16)(mag * (m->forwardVel / 5.0f)); + } if (targetPitchVel > 0) { if (m->angleVel[0] < 0) {