From 77e7080a8cc2b76eddb0bca6a0beeb0685288758 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Wed, 22 Jun 2022 12:27:13 +1000 Subject: [PATCH] Two-hand shield cheat fix: use 1-handed reflect anim (#504) --- .../overlays/actors/ovl_player_actor/z_player.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 93badd4f5..e66d234df 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2107,10 +2107,12 @@ LinkAnimationHeader* func_808346C4(GlobalContext* globalCtx, Player* this) { func_808323B4(globalCtx, this); if (this->unk_870 < 0.5f) { - return D_808543A4[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; + return D_808543A4[Player_HoldsTwoHandedWeapon(this) && + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } else { - return D_808543AC[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; + return D_808543AC[Player_HoldsTwoHandedWeapon(this) && + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } } @@ -3837,15 +3839,18 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { func_80833638(this, func_80834BD4); if (this->unk_870 < 0.5f) { - anim = D_808543BC[Player_HoldsTwoHandedWeapon(this)]; + anim = D_808543BC[Player_HoldsTwoHandedWeapon(this) && + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } else { - anim = D_808543B4[Player_HoldsTwoHandedWeapon(this)]; + anim = D_808543B4[Player_HoldsTwoHandedWeapon(this) && + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } LinkAnimation_PlayOnce(globalCtx, &this->skelAnime2, anim); } else { - func_80832264(globalCtx, this, D_808543C4[Player_HoldsTwoHandedWeapon(this)]); + func_80832264(globalCtx, this, D_808543C4[Player_HoldsTwoHandedWeapon(this) && + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]); } }