Jump to content

Recommended Posts

I don't understand, why are you sending game to client packets?

and this is not optimized, vec is copying object every time

 8e416d472f.PNG

  • Love 3

no paid service

use at least c++11 and VS19, otherwise I won't help.

Link to post
		if (iSlot >= 0 && iSlot <= INVENTORY_MAX_NUM && bCount >= 0 && bCount <= g_bItemCountLimit)
		{
			LPITEM item = ch->GetInventoryItem(iSlot);

			if (item)
			{
				BYTE bItemCount = item->GetCount();

				TItemPos ItemCell;

				ItemCell.window_type = INVENTORY;
				ItemCell.cell = item->GetCell();

				for (int i = 0; i < (bItemCount / bCount) - 1; ++i)
				{
					int iEmptySlot = ch->GetEmptyInventory(item->GetSize());

					TItemPos DestItemCell;

					DestItemCell.window_type = INVENTORY;
					DestItemCell.cell = iEmptySlot;

					ch->MoveItem(ItemCell, DestItemCell, bCount);
				}
			}
		}

 

With command that using args - (Item Slot & Split Count)

 

I don't know why you copy the Item, but items that can be Split have no Sockets & Bonus random so the copy seems useless (Is just a move from the count of the item).

Edited by HITRON (see edit history)
Link to post
  • VIP
On 11/1/2020 at 7:15 PM, HITRON said:
		if (iSlot >= 0 && iSlot <= INVENTORY_MAX_NUM && bCount >= 0 && bCount <= g_bItemCountLimit)
		{
			LPITEM item = ch->GetInventoryItem(iSlot);

			if (item)
			{
				BYTE bItemCount = item->GetCount();

				TItemPos ItemCell;

				ItemCell.window_type = INVENTORY;
				ItemCell.cell = item->GetCell();

				for (int i = 0; i < (bItemCount / bCount) - 1; ++i)
				{
					int iEmptySlot = ch->GetEmptyInventory(item->GetSize());

					TItemPos DestItemCell;

					DestItemCell.window_type = INVENTORY;
					DestItemCell.cell = iEmptySlot;

					ch->MoveItem(ItemCell, DestItemCell, bCount);
				}
			}
		}

 

With command that using args - (Item Slot & Split Count)

 

I don't know why you copy the Item, but items that can be Split have no Sockets & Bonus random so the copy seems useless (Is just a move from the count of the item).

Is this your split function? If it is I'd like to see a video of you trying to split all the items by 1 in a completly empty inventory. And yours doesn't do backward searching. Yeah maybe you can further optimize it without copying the socket and attributes, I haven't tried it tbh.

Link to post
  • VIP
On 11/3/2020 at 11:21 PM, Kafa said:

I have implemented it, but doesnt work and no syserr too

 

Updated the files, try implementing again. (Forgot to include some files sorry)

  • Love 1
Link to post


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.