Jump to content
  • We need you!

    You must register to discover all the features of our community!

C++ - Fix - When you open box the items won't stack


Recommended Posts

Hi,

 

char_item.cpp - CHARACTER::AutoGiveItem

Search for:  if (item->GetType() == ITEM_BLEND)

 

Replace the whole selection with:

 

if (item->IsStackable())
{
    for (int i=0; i < INVENTORY_MAX_NUM; i++)
    {
        LPITEM inv_item = GetInventoryItem(i);

        if (inv_item == NULL) 
            continue;

        if (inv_item->GetVnum() == item->GetVnum())
        {
            if (inv_item->GetSocket(0) == item->GetSocket(0) &&
                    inv_item->GetSocket(1) == item->GetSocket(1) &&
                    inv_item->GetSocket(2) == item->GetSocket(2) &&
                    inv_item->GetCount() < ITEM_MAX_COUNT)
            {
                inv_item->SetCount(inv_item->GetCount() + item->GetCount());
                M2_DESTROY_ITEM(item);
                return inv_item;
            }
        }
    }
}

 

Author: @systemdev93 (Back to the past)

  • Love 3
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Current Donation Goals

  • Activity

    1. 11

      Mysql56 to Mysql8

    2. 0

      Does anyone have Kami-Sama's Contact?

    3. 1

      [Trailer][1/3]NerviL2 The return of the Legend

    4. 0

      Won " price" change

    5. 10

      Inferna - The new "metin3"?

    6. 6

      We need you!

    7. 2

      Highlight system bug

  • Recently Browsing

    No registered users viewing this page.

×
×
  • 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.