Yardım AddToGround: sectree already assigned syserr hatası

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

mnyk2070

MT Üye
MT Üye
Editör
Mesaj
394
Çözümler
11
Beğeni
131
Puan
499
Ticaret Puanı
0
Kod:
AddToGround: sectree already assigned
şöyle bir syserr alıyorum sebebi ne olabilir
 
Burada bahsedilmiş.
Şimdi kaynak kodlarını analiz ediyordum. Yerde bulunan itemler oyuna entitiy olarak kayıt ediliyor. Daha net anlamanız için size kodları paylaşıyorum.
char_item.cpp
C++:
bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)
{
    LPITEM item = NULL;

    if (!CanHandleItem())
    {
        if (NULL != DragonSoul_RefineWindow_GetOpener())
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("강화창을 연 상태에서는 아이템을 옮길 수 없습니다."));
        return false;
    }

    if (IsDead())
        return false;

    if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
        return false;

    if (item->IsExchanging())
        return false;

    if (true == item->isLocked())
        return false;

    if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
        return false;

    if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_DROP | ITEM_ANTIFLAG_GIVE))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("버릴 수 없는 아이템입니다."));
        return false;
    }

    if (bCount == 0 || bCount > item->GetCount())
        bCount = item->GetCount();

    SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 255);    // Quickslot 에서 지움

    LPITEM pkItemToDrop;

    if (bCount == item->GetCount())
    {
        item->RemoveFromCharacter();
        pkItemToDrop = item;
    }
    else
    {
        if (bCount == 0)
        {
            if (test_server)
                sys_log(0, "[DROP_ITEM] drop item count == 0");
            return false;
        }

        item->SetCount(item->GetCount() - bCount);
        ITEM_MANAGER::instance().FlushDelayedSave(item);

        pkItemToDrop = ITEM_MANAGER::instance().CreateItem(item->GetVnum(), bCount);

        // copy item socket -- by mhh
        FN_copy_item_socket(pkItemToDrop, item);

        char szBuf[51 + 1];
        snprintf(szBuf, sizeof(szBuf), "%u %u", pkItemToDrop->GetID(), pkItemToDrop->GetCount());
        LogManager::instance().ItemLog(this, item, "ITEM_SPLIT", szBuf);
    }

    PIXEL_POSITION pxPos = GetXYZ();

    if (pkItemToDrop->AddToGround(GetMapIndex(), pxPos))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("떨어진 아이템은 3분 후 사라집니다."));
        pkItemToDrop->StartDestroyEvent();

        ITEM_MANAGER::instance().FlushDelayedSave(pkItemToDrop);

        char szHint[32 + 1];
        snprintf(szHint, sizeof(szHint), "%s %u %u", pkItemToDrop->GetName(), pkItemToDrop->GetCount(), pkItemToDrop->GetOriginalVnum());
        LogManager::instance().ItemLog(this, pkItemToDrop, "DROP", szHint);
        //Motion(MOTION_PICKUP);
    }

    return true;
}

AddToGround fonksiyonununa bakıyoruz şimdi;
item.cpp;
C++:
bool CItem::AddToGround(long lMapIndex, const PIXEL_POSITION & pos, bool skipOwnerCheck)
{
    if (0 == lMapIndex)
    {
        sys_err("wrong map index argument: %d", lMapIndex);
        return false;
    }

    if (GetSectree())
    {
        sys_err("sectree already assigned");
        return false;
    }

    if (!skipOwnerCheck && m_pOwner)
    {
        sys_err("owner pointer not null");
        return false;
    }

    LPSECTREE tree = SECTREE_MANAGER::instance().Get(lMapIndex, pos.x, pos.y);

    if (!tree)
    {
        sys_err("cannot find sectree by %dx%d", pos.x, pos.y);
        return false;
    }

    //tree->Touch();

    SetWindow(GROUND);
    SetXYZ(pos.x, pos.y, pos.z);
    tree->InsertEntity(this);
    UpdateSectree();
    Save();
    return true;
}

Bu da şu anlama geliyor. Entity bilgilerini alan kodlar büyük ihtimal yerde ki itemlerin bilgilerini de alıyor.
 
Geri
Üst