Skip to content

Commit

Permalink
fix duplicating flute glitch (#5436)
Browse files Browse the repository at this point in the history
Co-authored-by: ghoulslash <[email protected]>
  • Loading branch information
ghoulslash and ghoulslash authored Oct 3, 2024
1 parent d5560bb commit be5f2e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/party_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,6 @@ void MoveDeleterForgetMove(void);
void BufferMoveDeleterNicknameAndMove(void);
void GetNumMovesSelectedMonHas(void);
void MoveDeleterChooseMoveToForget(void);
bool32 IsItemFlute(u16 item);

#endif // GUARD_PARTY_MENU_H
4 changes: 2 additions & 2 deletions src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ static void HandleInputChooseAction(u32 battler)
&& !(gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)])
&& !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
// Return item to bag if partner had selected one.
if (gBattleResources->bufferA[battler][1] == B_ACTION_USE_ITEM)
// Return item to bag if partner had selected one (except flutes).
if (gBattleResources->bufferA[battler][1] == B_ACTION_USE_ITEM && !IsItemFlute(itemId))
{
AddBagItem(itemId, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/party_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4578,7 +4578,7 @@ static bool8 NotUsingHPEVItemOnShedinja(struct Pokemon *mon, u16 item)
return TRUE;
}

static bool8 IsItemFlute(u16 item)
bool32 IsItemFlute(u16 item)
{
if (item == ITEM_BLUE_FLUTE || item == ITEM_RED_FLUTE || item == ITEM_YELLOW_FLUTE)
return TRUE;
Expand Down

0 comments on commit be5f2e0

Please sign in to comment.