mirror of
https://github.com/pret/pokeemerald.git
synced 2026-05-09 04:13:03 -05:00
Merge 60410b0b66 into e178c18bf4
This commit is contained in:
commit
f75f597517
|
|
@ -58,7 +58,7 @@ u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos);
|
|||
u16 BagGetQuantityByPocketPosition(u8 pocketId, u16 pocketPos);
|
||||
void CompactItemsInBagPocket(struct BagPocket *bagPocket);
|
||||
void SortBerriesOrTMHMs(struct BagPocket *bagPocket);
|
||||
void MoveItemSlotInList(struct ItemSlot *itemSlots_, u32 from, u32 to_);
|
||||
void MoveItemSlotInList(struct ItemSlot *itemSlots, u32 from, u32 to);
|
||||
void ClearBag(void);
|
||||
u16 CountTotalItemQuantityInBag(u16 itemId);
|
||||
bool8 AddPyramidBagItem(u16 itemId, u16 count);
|
||||
|
|
|
|||
39
src/item.c
39
src/item.c
|
|
@ -632,30 +632,29 @@ void SortBerriesOrTMHMs(struct BagPocket *bagPocket)
|
|||
}
|
||||
}
|
||||
|
||||
void MoveItemSlotInList(struct ItemSlot *itemSlots_, u32 from, u32 to_)
|
||||
void MoveItemSlotInList(struct ItemSlot *itemSlots, u32 from, u32 to)
|
||||
{
|
||||
// dumb assignments needed to match
|
||||
struct ItemSlot *itemSlots = itemSlots_;
|
||||
u32 to = to_;
|
||||
struct ItemSlot firstSlot;
|
||||
s16 i;
|
||||
|
||||
if (from != to)
|
||||
if (from == to)
|
||||
return;
|
||||
|
||||
firstSlot = itemSlots[from];
|
||||
|
||||
if (to > from)
|
||||
{
|
||||
s16 i, count;
|
||||
struct ItemSlot firstSlot = itemSlots[from];
|
||||
|
||||
if (to > from)
|
||||
{
|
||||
to--;
|
||||
for (i = from, count = to; i < count; i++)
|
||||
itemSlots[i] = itemSlots[i + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = from, count = to; i > count; i--)
|
||||
itemSlots[i] = itemSlots[i - 1];
|
||||
}
|
||||
itemSlots[to] = firstSlot;
|
||||
to--;
|
||||
for (i = (s16)from; i < (s16)to; i++)
|
||||
itemSlots[i] = itemSlots[i + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = (s16)from; i > (s16)to; i--)
|
||||
itemSlots[i] = itemSlots[i - 1];
|
||||
}
|
||||
|
||||
itemSlots[to] = firstSlot;
|
||||
}
|
||||
|
||||
void ClearBag(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user