Make flying use first person pitch

This commit is contained in:
Agent X 2023-12-14 15:23:22 -05:00
parent 276255a0f1
commit 026c2fe550
1 changed files with 5 additions and 0 deletions

View File

@ -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) {