Jump to content

Question

Posted

Hi guys I would like to ask for some help to modify @storeall which will include cart.

I've tried modifying it but it still doesn't read the cart.

Here's my current @storeall mod.

Thanks!

ACMD_FUNC(storeall)
{
	int i;
	nullpo_retr(-1, sd);

	if (sd->state.storage_flag != 1)
  	{	//Open storage.
		if( storage_storageopen(sd) == 1 ) {
			clif_displaymessage(fd, "You can't open the storage currently.");
			return -1;
		}
	}
        // Cart
	for (i = 0; i < MAX_CART; i++) {
		if (sd->status.cart[i].amount) {
			if(sd->status.cart[i].equip != 0)
				pc_unequipitem(sd, i, 3);
			storage_storageadd(sd,  i, sd->status.cart[i].amount);
		}
	}
        // Inventory
	for (i = 0; i < MAX_INVENTORY; i++) {
		if (sd->status.inventory[i].amount) {
			if(sd->status.inventory[i].equip != 0)
				pc_unequipitem(sd, i, 3);
			storage_storageadd(sd,  i, sd->status.inventory[i].amount);
		}
	}

	storage_storageclose(sd);

	clif_displaymessage(fd, "It is done");
	return 0;
}

2 answers to this question

Recommended Posts

  • 0
Posted

storage_storageadd() gets items from your inventory, not the cart.

 

There is a storage_storageaddfromcart() function, which you would use instead.

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...