Fix Arrow Cycle Aim Drift (#6118)

This commit is contained in:
mckinlee
2026-01-07 21:33:08 -05:00
committed by GitHub
parent 307cd7f8cd
commit f72ee2b814

View File

@@ -28,6 +28,7 @@ static const s16 BUTTON_HIGHLIGHT_ALPHA = 128;
static s16 sButtonFlashTimer = 0;
static s16 sButtonFlashCount = 0;
static s16 sJustCycledFrames = 0;
static const PlayerItemAction sArrowCycleOrder[] = {
PLAYER_IA_BOW,
@@ -217,6 +218,7 @@ static void CycleToNextArrow(PlayState* play, Player* player) {
UpdateEquippedBow(play, nextArrow);
Audio_PlaySoundGeneral(NA_SE_PL_CHANGE_ARMS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sJustCycledFrames = 2;
}
void ArrowCycleMain() {
@@ -224,6 +226,10 @@ void ArrowCycleMain() {
return;
}
if (sJustCycledFrames > 0) {
sJustCycledFrames--;
}
UpdateFlashEffect(gPlayState);
Player* player = GET_PLAYER(gPlayState);
@@ -250,8 +256,9 @@ void RegisterArrowCycle() {
COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_ARROW_CYCLE_VALUE, {
Player* player = (Player*)va_arg(args, void*);
Input* input = (Input*)va_arg(args, void*);
if (IsAimingBow(player) && CHECK_BTN_ANY(input->cur.button, BTN_R)) {
*should = false;
if ((IsAimingBow(player) || sJustCycledFrames > 0) && CHECK_BTN_ANY(input->cur.button, BTN_R)) {
input->cur.button &= ~BTN_R;
input->press.button &= ~BTN_R;
}
});