Jump to content
×
×
  • Create New...
  • 0

RemoveFromCharacter Game Core


cekaskartos8

Question

Hi,

I have this syser and game core :S

SYSERR: Sep 16 12:08:52 :: DestroyItem: WTH! Invalid item owner. owner pointer : 0x5bfaf000
SYSERR: Sep 16 12:09:48 :: RemoveFromCharacter: Item::RemoveFromCharacter owner null

and

SYSERR: Sep 16 15:03:02 :: GetWear: CHARACTER::GetWear: invalid wear cell 201
SYSERR: Sep 16 15:03:02 :: Unequip: m_pOwner->GetWear() != this

Help me please 

gdb ;

 

#0  0x0817ad19 in ITEM_MANAGER::DestroyItem (this=0xffffa5b8, item=0x35bb35a0)
    at item_manager.cpp:590
590             M2_DELETE(item);
[New LWP 100179]
(gdb)
 

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0
  • Premium
47 minutes ago, salepcitizz said:

up help

add offline shop 

SYSERR: Sep 16 12:09:48 :: RemoveFromCharacter: Item::RemoveFromCharacter owner null

 

We don't have the magical sphere, if you think we do, sorry for you.

Share the code snippet you're talking about or don't ask for help.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • 0

	LPITEM CItem::RemoveFromCharacter()
{
    if (!m_pOwner)
    {
        sys_err("Item::RemoveFromCharacter owner null");
        return (this);
    }
	    LPCHARACTER pOwner = m_pOwner;
	    if (m_bEquipped)    // ÀåÂøµÇ¾ú´Â°¡?
    {
        Unequip();
        //pOwner->UpdatePacket();
	        SetWindow(RESERVED_WINDOW);
        Save();
        return (this);
    }
    else
    {
        if (GetWindow() != SAFEBOX && GetWindow() != MALL)
        {
            if (IsDragonSoul())
            {
                if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
                    sys_err("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM");
                else
                    pOwner->SetItem(TItemPos(m_bWindow, m_wCell), NULL);
            }
            else
            {
                TItemPos cell(INVENTORY, m_wCell);
	                if (false == cell.IsDefaultInventoryPosition() && false == cell.IsBeltInventoryPosition()) // ¾Æ´Ï¸é ¼ÒÁöÇ°¿¡?
                    sys_err("CItem::RemoveFromCharacter: Invalid Item Position");
                else
                {
                    pOwner->SetItem(cell, NULL);
                }
            }
        }
	        m_pOwner = NULL;
        m_wCell = 0;
	        SetWindow(RESERVED_WINDOW);
        Save();
        return (this);
    }
}
	

Link to comment
Share on other sites

  • 0

	#ifndef DEBUG_ALLOC
void ITEM_MANAGER::DestroyItem(LPITEM item)
#else
void ITEM_MANAGER::DestroyItem(LPITEM item, const char* file, size_t line)
#endif
{
    if (item->GetSectree())
        item->RemoveFromGround();
	    if (item->GetOwner())
    {
        if (CHARACTER_MANAGER::instance().Find(item->GetOwner()->GetPlayerID()) != NULL)
        {
            sys_err("DestroyItem: GetOwner %s %s!!", item->GetName(), item->GetOwner()->GetName());
            item->RemoveFromCharacter();
        }
        else
        {
            sys_err ("WTH! Invalid item owner. owner pointer : %p", item->GetOwner());
        }
    }
	    TR1_NS::unordered_set<LPITEM>::iterator it = m_set_pkItemForDelayedSave.find(item);
	    if (it != m_set_pkItemForDelayedSave.end())
        m_set_pkItemForDelayedSave.erase(it);
	    DWORD dwID = item->GetID();
    sys_log(2, "ITEM_DESTROY %s:%u", item->GetName(), dwID);
	    if (!item->GetSkipSave() && dwID)
    {
        DWORD dwOwnerID = item->GetLastOwnerPID();
	        db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD));
        db_clientdesc->Packet(&dwID, sizeof(DWORD));
        db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD));
    }
    else
    {
        sys_log(2, "ITEM_DESTROY_SKIP %s:%u (skip=%d)", item->GetName(), dwID, item->GetSkipSave());
    }
	    if (dwID)
        m_map_pkItemByID.erase(dwID);
	    m_VIDMap.erase(item->GetVID());
	#ifdef M2_USE_POOL
    pool_.Destroy(item);
#else
#ifndef DEBUG_ALLOC
    M2_DELETE(item);
#else
    M2_DELETE_EX(item, file, line);
#endif
#endif
}

Link to comment
Share on other sites

  • 0
  • Premium

Bro this problem can be maked from a Lamer that's crashing you core.

You need to understand the system that's doing 

DestroyItem

Show the code where you use DestroyItem.

 

and publish full game.core

 

bt full

Link to comment
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.