Skip to content

Commit

Permalink
Fix move-in-first-person applying in movement locked actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez committed Nov 25, 2024
1 parent 271e814 commit a5840a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mm/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -12210,7 +12210,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {

this->actor.shape.face = ((play->gameplayFrames & 0x20) ? 0 : 3) + this->blinkInfo.eyeTexIndex;

if (GameInteractor_Should(VB_CONSIDER_BUNNY_HOOD_EQUIPPED, this->currentMask == PLAYER_MASK_BUNNY, this)) {
if (GameInteractor_Should(VB_CONSIDER_BUNNY_HOOD_EQUIPPED, this->currentMask == PLAYER_MASK_BUNNY)) {
Player_UpdateBunnyEars(this);
}

Expand Down Expand Up @@ -13088,10 +13088,14 @@ s32 Ship_HandleFirstPersonAiming(PlayState* play, Player* this, s32 arg2) {
this->actor.focus.rot.y = CLAMP(var_s0 + gyroX, -0x4AAA, 0x4AAA) + this->actor.shape.rot.y;
}

if (CVarGetInteger("gEnhancements.Camera.FirstPerson.MoveInFirstPerson", 0) &&
bool playerMovementLocked = (this->actionFunc == Player_Action_52) || // Riding on Epona
(this->actionFunc == Player_Action_80) || // Riding swamp boat (non-archery)
(this->actionFunc == Player_Action_81); // Bow minigames

if (!playerMovementLocked && CVarGetInteger("gEnhancements.Camera.FirstPerson.MoveInFirstPerson", 0) &&
CVarGetInteger("gEnhancements.Camera.FirstPerson.RightStickEnabled", 0)) {
f32 movementSpeed = 8.25f; // account for form
if (this->currentMask == PLAYER_MASK_BUNNY) {
if (GameInteractor_Should(VB_CONSIDER_BUNNY_HOOD_EQUIPPED, this->currentMask == PLAYER_MASK_BUNNY)) {
movementSpeed *= 1.5f;
}

Expand Down Expand Up @@ -14592,7 +14596,7 @@ void Player_Action_13(Player* this, PlayState* play) {

Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play);

if (GameInteractor_Should(VB_CONSIDER_BUNNY_HOOD_EQUIPPED, this->currentMask == PLAYER_MASK_BUNNY, this)) {
if (GameInteractor_Should(VB_CONSIDER_BUNNY_HOOD_EQUIPPED, this->currentMask == PLAYER_MASK_BUNNY)) {
speedTarget *= 1.5f;
}

Expand Down

0 comments on commit a5840a0

Please sign in to comment.