From 5d346fd9392eb718dce06875a26538691343f582 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 31 Aug 2022 23:49:43 -0300 Subject: [PATCH] Updated a couple more sizeofs --- src/battle_pyramid_bag.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 9fab996da8..7a4d981f01 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1404,20 +1404,20 @@ void TryStoreHeldItemsInPyramidBag(void) { u8 i; struct Pokemon *party = gPlayerParty; - u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); - u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems)); + u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities)); u16 heldItem; - memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); - memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + 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(*newQuantities)); for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM); if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1)) { // 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.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + 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(*newQuantities)); Free(newItems); Free(newQuantities); gSpecialVar_Result = 1;