From 60f5f3302d591971245b0e6e5025b8e124f2307c Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sun, 17 Aug 2025 21:49:53 +0200 Subject: [PATCH] Fix tossing a stack of berries hiding following berries (#7571) Co-authored-by: Hedara --- src/item.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/item.c b/src/item.c index 6802b2272c..162798acde 100644 --- a/src/item.c +++ b/src/item.c @@ -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; }