Jump to content

Game Core Crash CreateDropItemVector


Recommended Posts

hello, i have a core crash on channel 1. 

When i used gdb (game debugger) those are the error i got

 

Quote

Program terminated with signal SIGSEGV, Segmentation fault. #0 ITEM_MANAGER::CreateDropItemVector (this=0xffffa664, pkChr=0x0, pkKiller=0x3c236000, vec_item=...) at item_manager.cpp:848 848 item_manager.cpp: No such file or directory.

 

this is when i used the 'bt' command :

Quote

#0 ITEM_MANAGER::CreateDropItemVector (this=0xffffa664, pkChr=0x0, pkKiller=0x3c236000, vec_item=...) at item_manager.cpp:848 #1 0x08182f92 in CInputMain::TargetInfoLoad (this=0x6043e81c, ch=0x3c236000, c_pData=0x599e0e00 ";") at input_main.cpp:71 #2 0x08188654 in CInputMain::Analyze (this=0x6043e81c, d=0x6043e780, bHeader=<optimized out>, c_pData=0x599e0e00 ";") at input_main.cpp:3441 #3 0x0816fb2b in CInputProcessor::Process (this=0x6043e81c, lpDesc=0x6043e780, c_pvOrig=0x599e0e00, iBytes=6, r_iBytesProceed=@0xffffa554: 0) at input.cpp:103 #4 0x08138de3 in DESC::ProcessInput (this=0x6043e780) at desc.cpp:313 #5 0x08297194 in io_loop (fdw=0x29137280) at main.cpp:1072 #6 0x08297bc1 in idle () at main.cpp:949 #7 0x08299221 in main (argc=1, argv=0xffffdc5c) at main.cpp:610

 

This is the CreateDropItemVector from item_manager.cpp :

 

Quote

 

#ifdef __SEND_TARGET_INFO__
bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item)
{
    if (pkChr->IsPolymorphed() || pkChr->IsPC())
    {
        return false;
    }

    int iLevel = pkKiller->GetLevel();

    BYTE bRank = pkChr->GetMobRank();
    LPITEM item = NULL;

    std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin();

    while (it != g_vec_pkCommonDropItem[bRank].end())
    {
        const CItemDropInfo & c_rInfo = *(it++);

        if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd)
            continue;

        TItemTable * table = GetTable(c_rInfo.m_dwVnum);

        if (!table)
            continue;

        item = NULL;

        if (table->bType == ITEM_POLYMORPH)
        {
            if (c_rInfo.m_dwVnum == pkChr->GetPolymorphItemVnum())
            {
                item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);

                if (item)
                    item->SetSocket(0, pkChr->GetRaceNum());
            }
        }
        else
            item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);

        if (item) vec_item.push_back(item);
    }

    // Drop Item Group
    {
        itertype(m_map_pkDropItemGroup) it;
        it = m_map_pkDropItemGroup.find(pkChr->GetRaceNum());

        if (it != m_map_pkDropItemGroup.end())
        {
            typeof(it->second->GetVector()) v = it->second->GetVector();

            for (DWORD i = 0; i < v.size(); ++i)
            {
                item = CreateItem(v.dwVnum, v.iCount, 0, true);

                if (item)
                {
                    if (item->GetType() == ITEM_POLYMORPH)
                    {
                        if (item->GetVnum() == pkChr->GetPolymorphItemVnum())
                        {
                            item->SetSocket(0, pkChr->GetRaceNum());
                        }
                    }

                    vec_item.push_back(item);
                }
            }
        }
    }

    // MobDropItem Group
    {
        itertype(m_map_pkMobItemGroup) it;
        it = m_map_pkMobItemGroup.find(pkChr->GetRaceNum());

        if ( it != m_map_pkMobItemGroup.end() )
        {
            CMobItemGroup* pGroup = it->second;

            // MOB_DROP_ITEM_BUG_FIX
            // 20050805.myevan.MobDropItem ? ???? ?? ?? CMobItemGroup::GetOne() ??? ?? ?? ??
            if (pGroup && !pGroup->IsEmpty())
            {
                const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne();
                item = CreateItem(info.dwItemVnum, info.iCount, 0, true, info.iRarePct);

                if (item) vec_item.push_back(item);
            }
            // END_OF_MOB_DROP_ITEM_BUG_FIX
        }
    }

    // Level Item Group
    {
        itertype(m_map_pkLevelItemGroup) it;
        it = m_map_pkLevelItemGroup.find(pkChr->GetRaceNum());

        if ( it != m_map_pkLevelItemGroup.end() )
        {
            if ( it->second->GetLevelLimit() <= (DWORD)iLevel )
            {
                typeof(it->second->GetVector()) v = it->second->GetVector();

                for ( DWORD i=0; i < v.size(); i++ )
                {
                    DWORD dwVnum = v.dwVNum;
                    item = CreateItem(dwVnum, v.iCount, 0, true);
                    if ( item ) vec_item.push_back(item);
                }
            }
        }
    }

    // BuyerTheitGloves Item Group
    {
        // by mhh ?? ??? ??? ?? drop ? ???? ??
        if (pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0 ||
                pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM))
        {
            itertype(m_map_pkGloveItemGroup) it;
            it = m_map_pkGloveItemGroup.find(pkChr->GetRaceNum());

            if (it != m_map_pkGloveItemGroup.end())
            {
                typeof(it->second->GetVector()) v = it->second->GetVector();

                for (DWORD i = 0; i < v.size(); ++i)
                {
                    
                    DWORD dwVnum = v.dwVnum;
                    item = CreateItem(dwVnum, v.iCount, 0, true);
                    if (item) vec_item.push_back(item);
                }
            }
        }
    }

    // ??
    if (pkChr->GetMobDropItemVnum())
    {
        itertype(m_map_dwEtcItemDropProb) it = m_map_dwEtcItemDropProb.find(pkChr->GetMobDropItemVnum());

        if (it != m_map_dwEtcItemDropProb.end())
        {        
            item = CreateItem(pkChr->GetMobDropItemVnum(), 1, 0, true);
            if (item) vec_item.push_back(item);
        }
    }

    if (pkChr->IsStone())
    {
        if (pkChr->GetDropMetinStoneVnum())
        {
            item = CreateItem(pkChr->GetDropMetinStoneVnum(), 1, 0, true);
            if (item) vec_item.push_back(item);
        }
    }

    return vec_item.size();
}

 #endif

  

If you want the BT FULL command, i have it on my PC, but maybe someone will know how to help me.

I'm desperate, it crashes every few hours.

Edited by diangelisp
Link to comment
Share on other sites

  • Premium
bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item)
{
    if (!pkChr || !pkKiller)
        return false;
  
    if (pkChr->IsPolymorphed() || pkChr->IsPC())
        return false;

...........

}

 

  • Love 3
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

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