Fix hookshot retraction on dpad (#2065)

This commit is contained in:
aMannus 2022-12-05 01:27:15 +01:00 committed by GitHub
parent d4aeb79341
commit 5d2b794c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,6 +257,10 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x); sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y); sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z); sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);
u16 buttonsToCheck = BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
if (CVar_GetS32("gDpadEquips", 0) != 0) {
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
}
if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true, if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true,
&bgId) && &bgId) &&
!func_8002F9EC(play, &this->actor, poly, bgId, &sp78)) { !func_8002F9EC(play, &this->actor, poly, bgId, &sp78)) {
@ -281,8 +285,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8); &D_801333E0, &D_801333E8);
} }
} else if (CHECK_BTN_ANY(play->state.input[0].press.button, } else if (CHECK_BTN_ANY(play->state.input[0].press.button, (buttonsToCheck))) {
(BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN))) {
this->timer = 0; this->timer = 0;
} }
} }