Updated a couple more sizeofs

This commit is contained in:
LOuroboros 2022-08-31 23:49:43 -03:00
parent b66de1f056
commit 5d346fd939
1 changed files with 6 additions and 6 deletions

View File

@ -1404,20 +1404,20 @@ void TryStoreHeldItemsInPyramidBag(void)
{ {
u8 i; u8 i;
struct Pokemon *party = gPlayerParty; struct Pokemon *party = gPlayerParty;
u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
u16 heldItem; u16 heldItem;
memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM); heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM);
if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1)) if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1))
{ {
// Cant store party held items in pyramid bag because bag is full // Cant store party held items in pyramid bag because bag is full
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
Free(newItems); Free(newItems);
Free(newQuantities); Free(newQuantities);
gSpecialVar_Result = 1; gSpecialVar_Result = 1;