From 2064618b0f70d0d8bf83e1c3ee6a5539991bae5d Mon Sep 17 00:00:00 2001 From: Reppan <72985260+Jepvid@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:33:13 +0200 Subject: [PATCH] Add Function to custom equipment to guard against cutscene shenanigans (#7409) --- soh/soh/Enhancements/customequipment.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index 3e08c536d9..94f5bda98e 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -71,6 +71,16 @@ static bool UsesBowModel(Player* player) { return LINK_IS_ADULT; } +// Detects cutscenes that swap the left hand DL without updating leftHandType. +static bool IsLeftHandSwappedByCutscene(Player* player) { + Gfx** dLists = player->leftHandDLists; + if (dLists == &gPlayerLeftHandOpenDLs[0] || dLists == &gPlayerLeftHandOpenDLs[1] || + dLists == &gPlayerLeftHandClosedDLs[0] || dLists == &gPlayerLeftHandClosedDLs[1]) { + return true; + } + return dLists == &gPlayerLeftHandBgsDLs[1] && player->leftHandType != PLAYER_MODELTYPE_LH_BGS; +} + static u8 sLastValidSwordEquip = EQUIP_VALUE_SWORD_NONE; static u8 GetEquippedSwordValue(PlayState* play) { @@ -260,6 +270,8 @@ static void RegisterCustomEquipment() { } break; } + if (IsLeftHandSwappedByCutscene(player)) + break; switch ((u8)player->leftHandType) { case PLAYER_MODELTYPE_LH_SWORD: { if (player == GET_PLAYER(play)) {