[DiscordArchive] What slots does it want?
[DiscordArchive] What slots does it want?
Archived author: Foe • Posted: 2023-01-21T19:52:59.946000+00:00
Original source
```C++
// in bank bags
for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
{
if (Bag* bag = GetBagByPos(i))
{
for (uint32 j = 0; j < bag->GetBagSize(); j++)```
Archived author: Foe • Posted: 2023-01-21T19:54:13.395000+00:00
Original source
where j would be the correct item pos in sub-bags
Archived author: Foe • Posted: 2023-01-21T19:54:31.212000+00:00
Original source
if (Item* item = bag->GetItemByPos(j))
Archived author: Bench • Posted: 2023-01-21T20:31:37.690000+00:00
Original source
So what I'm getting from this is that StoreNewItem doesn't work for what I'm trying to use it for
Archived author: Foe • Posted: 2023-01-21T20:35:27.752000+00:00
Original source
```C++
// declare destination value
ItemPosCountVec dest;
// create new item
Item* pNewItem = Item::CreateItem(item, count, this, false, randomPropertyId);
// check whether an item can be stored in said slot, also returns the correct destination variable
InventoryResult msg = CanBankItem(dstbag, dstslot, dest, pNewItem, false);
if (msg != EQUIP_ERR_OK)
{
return;
}
// store new item
BankItem(dest, pNewItem, true);
```
Archived author: Foe • Posted: 2023-01-21T20:35:31.415000+00:00
Original source
That should work
Archived author: Foe • Posted: 2023-01-21T20:38:42.844000+00:00
Original source
There, edited it a bit
Archived author: Bench • Posted: 2023-01-21T20:39:38.508000+00:00
Original source
I'll give it a test in a bit, thank you
Archived author: Foe • Posted: 2023-01-21T20:39:50.948000+00:00
Original source
But you have to create the new item from an item template or something and then store it with BankItem
Archived author: Foe • Posted: 2023-01-21T20:39:57.787000+00:00
Original source
Instead of StoreNewItem