mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-10-21 10:51:32 -04:00
Add function to customequipment to fix shooting gallery (#7370)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user