Fix tossing a stack of berries hiding following berries (#7571)

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2025-08-17 21:49:53 +02:00 committed by GitHub
parent 905bda386f
commit 60f5f3302d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,7 @@ static bool32 CheckPyramidBagHasItem(u16 itemId, u16 count);
static bool32 CheckPyramidBagHasSpace(u16 itemId, u16 count);
static const u8 *GetItemPluralName(u16);
static bool32 DoesItemHavePluralName(u16);
static void NONNULL BagPocket_CompactItems(struct BagPocket *pocket);
EWRAM_DATA struct BagPocket gBagPockets[POCKETS_COUNT] = {0};
@ -391,6 +392,9 @@ static bool32 NONNULL BagPocket_RemoveItem(struct BagPocket *pocket, u16 itemId,
}
}
if (totalQuantity == count)
BagPocket_CompactItems(pocket);
Free(tempPocketSlotQuantities);
return totalQuantity >= count;
}