Jump to content
×
×
  • Create New...

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 comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 7

      Wear (use) item only on specific map

    2. 4

      Python tool for analyzing average yang drop per hour in each map.

    3. 162

      Plechito - Halloween 2022

    4. 0

      disable quest esc

    5. 7

      Wear (use) item only on specific map

    6. 7

      Wear (use) item only on specific map

    7. 7

      Wear (use) item only on specific map

    8. 4

      max level exp

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.