fix duplicating flute glitch (#5436)

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
ghoulslash 2024-10-03 07:01:18 -04:00 committed by GitHub
parent d5560bbc87
commit be5f2e095e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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;