Add function to customequipment to fix shooting gallery (#7370)

This commit is contained in:
Reppan
2026-10-11 20:50:58 +02:00
committed by GitHub
parent 0a8b53a740
commit c2325bd751
+12 -2
View File
@@ -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