summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReppan <72985260+Jepvid@users.noreply.github.com>2026-10-11 20:50:58 +0200
committerGitHub <noreply@github.com>2026-10-11 18:50:58 +0000
commitc2325bd751ac3cac4d1854d0b95f3eb56e0dacae (patch)
tree68cbae0e5f901b4e00e8fa582d31fb6c4a29699e
parent0a8b53a740acf5e7e6bc947e86a77c79c8bfb342 (diff)
Add function to customequipment to fix shooting gallery (#7370)
-rw-r--r--soh/soh/Enhancements/customequipment.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp
index a162d3d10..3e08c536d 100644
--- a/soh/soh/Enhancements/customequipment.cpp
+++ b/soh/soh/Enhancements/customequipment.cpp
@@ -61,6 +61,16 @@ static Gfx* LoadCustomGfx(const char* path) {
return ResourceMgr_LoadGfxByName(path);
}
+// Shooting Gallery being weird giving bow and then load slingshot model when child Link
+// This function is used to determine if bow or slingshot model should be loaded
+static bool UsesBowModel(Player* player) {
+ if (CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) ||
+ CVarGetInteger(CVAR_ENHANCEMENT("EquipmentAlwaysVisible"), 0)) {
+ return !Player_HoldsSlingshot(player);
+ }
+ return LINK_IS_ADULT;
+}
+
static u8 sLastValidSwordEquip = EQUIP_VALUE_SWORD_NONE;
static u8 GetEquippedSwordValue(PlayState* play) {
@@ -317,7 +327,7 @@ static void RegisterCustomEquipment() {
case PLAYER_MODELTYPE_RH_BOW_SLINGSHOT_2:
fpsHand = isAdult ? gCustomAdultFPSHandDL : gCustomChildFPSHandDL;
fpsWeapon =
- Player_HoldsBow(player)
+ UsesBowModel(player)
? ResolveCustomChain({ gCustomFPSBowDL, gCustomBowDL, nullptr })
: ResolveCustomChain({ gCustomFPSSlingshotDL, gCustomSlingshotDL, nullptr });
break;
@@ -391,7 +401,7 @@ static void RegisterCustomEquipment() {
break;
case PLAYER_MODELTYPE_RH_BOW_SLINGSHOT:
case PLAYER_MODELTYPE_RH_BOW_SLINGSHOT_2:
- customDL = Player_HoldsBow(player) ? gCustomBowDL : gCustomSlingshotDL;
+ customDL = UsesBowModel(player) ? gCustomBowDL : gCustomSlingshotDL;
break;
case PLAYER_MODELTYPE_RH_HOOKSHOT:
customDL = (player->heldItemAction == PLAYER_IA_HOOKSHOT) ? gCustomHookshotDL