Yardım Game Build Warningleri #3

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

aykutleee

Üye
Üye
Merhabalar. Çözümünü bulamadığım diğer warninglerim :/ 2 filesle karşılaştırarak yapıyorum ancak satır satır aynı bazıları ama bende hata veriyor

Warning - 1
############################
iLimitTimerBasedOnWearFlagIndex ibaresi sourcemde tek bu cpp de bu fonksiyonda 2 adet var

Adsız501.png


C++:
bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
{
    int iLimitRealtimeStartFirstUseFlagIndex = -1;
    int iLimitTimerBasedOnWearFlagIndex = -1;              /* 2163.satır */

    WORD wDestCell = DestCell.cell;
    BYTE bDestInven = DestCell.window_type;
    for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
    {
        long limitValue = item->GetProto()->aLimits[i].lValue;

        switch (item->GetProto()->aLimits[i].bType)
        {
            case LIMIT_LEVEL:
                if (GetLevel() < limitValue)
                {
                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ÆÀÌÅÛÀÇ ·¹º§ Á¦ÇѺ¸´Ù ·¹º§ÀÌ ³·½À´Ï´Ù."));
                    return false;
                }
                break;

            case LIMIT_REAL_TIME_START_FIRST_USE:
                iLimitRealtimeStartFirstUseFlagIndex = i;
                break;

            case LIMIT_TIMER_BASED_ON_WEAR:
                iLimitTimerBasedOnWearFlagIndex = i;
                break;
        }
    }
    .
    .
    .

Warning - 2
############################
Kadim efsun sistemi. Bu sistemim cmd_general.cpp de daha çok hatası vardı ancak parantezle çoğu halloldu bunları halledemedim (targetItemPos sourcemde sadece bu fonksiyon içinde mevcut başka yerde yok)

Adsız15.png


C++:
#ifdef WJ_ELDER_ATTRIBUTE_SYSTEM
ACMD(do_add_new_attribute)
{
    std::vector<std::string> vecArgs;
    split_argument(argument,vecArgs);
   
    if (vecArgs.size() < 6)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_UNKNOWN_ARGUMENT"));
        return;
    }
   
    int sourceItemPos, targetItemPos, attrtype0, attrtype1, attrtype2, attrtype3; /*3031.satır*/
       
    str_to_number(sourceItemPos, vecArgs[1].c_str());
    str_to_number(targetItemPos, vecArgs[2].c_str());
    str_to_number(attrtype0, vecArgs[3].c_str());
    str_to_number(attrtype1, vecArgs[4].c_str());
    str_to_number(attrtype2, vecArgs[5].c_str());
    str_to_number(attrtype3, vecArgs[6].c_str());
   
    LPITEM item = ch->GetInventoryItem(targetItemPos);
   
    if (!item)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_CANNOT_FIND_ITEM"));
        return;
    }
   
    if (item->GetType() != ITEM_WEAPON && item->GetType() != ITEM_ARMOR)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_COSTUME"));
        return;
    }
   
    if (item->IsEquipped())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EQUIPPED"));
        return;
    }
   
    if (item->IsExchanging())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EXCHANGING"));
        return;
    }

    if (ch->CountSpecifyItem(40009) < 1)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ENOUGH_NEW_ATTRIBUTE"));
        return;
    }
   
    TItemTable const * pProto = item->GetProto();
   
    bool addontype = false;
    if (pProto && pProto->sAddonType)
        addontype = true;
   
    int attrtype0prob = number(1,5), attrtype1prob = number(1,5), attrtype2prob = number(1,5), attrtype3prob = number(1,5);
   
    bool error = false;
    if (addontype == false)
    {
        if (attrtype0 == attrtype1 || attrtype0 == attrtype2 || attrtype0 == attrtype3 || attrtype0 == item->GetAttributeType(4))
            error = true;
        if (attrtype1 == attrtype0 || attrtype1 == attrtype2 || attrtype1 == attrtype3 || attrtype1 == item->GetAttributeType(4))
            error = true;
        if ((attrtype2 == attrtype0) || (attrtype2 == attrtype0) || (attrtype2 == attrtype3) || (attrtype2 == item->GetAttributeType(4)))
            error = true;
        if ((attrtype3 == attrtype0) || (attrtype3 == attrtype1) || (attrtype3 == attrtype2) || (attrtype3 == item->GetAttributeType(4)))
            error = true;
        if (item->GetAttributeType(4) == attrtype0 || item->GetAttributeType(4) == attrtype1 || item->GetAttributeType(4) == attrtype2 || item->GetAttributeType(4) == attrtype3)
            error = true;
    }
    else
    {
        if ((attrtype0 == attrtype1) || (attrtype0 == item->GetAttributeType(4))) /*3096.satır*/
            error = true;
        if ((attrtype1 == attrtype0) || (attrtype1 == item->GetAttributeType(4)))
            error = true;
    }

    for (int i=0; i < 4; ++i)
    {
        if (addontype == false)
        {
            if (item->GetAttributeType(i) == attrtype0 && i != 0)
                error = true;
            if (item->GetAttributeType(i) == attrtype1 && i != 1)
                error = true;
            if (item->GetAttributeType(i) == attrtype2 && i != 2)
                error = true;
            if (item->GetAttributeType(i) == attrtype3 && i != 3)
                error = true;
        }
        else
        {
            if (item->GetAttributeType(i+2) == attrtype0 && i != 0)
                error = true;
            if (item->GetAttributeType(i+2) == attrtype1 && i != 1)
                error = true;          
        }
    }
    if (error)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ERROR"));
        return;
    }
   
    if (addontype == false)
    {
        item->AddNewAttr(0, attrtype0, attrtype0prob);
        item->AddNewAttr(1, attrtype1, attrtype1prob);
        item->AddNewAttr(2, attrtype2, attrtype2prob);
        item->AddNewAttr(3, attrtype3, attrtype3prob);
    }
    else
    {  
        int oldattr5type = item->GetAttributeType(4), oldattr5value = item->GetAttributeValue(4);
        // int oldattr5value = item->GetAttributeValue(4);

        item->RemoveAttributeAt(0);
        item->RemoveAttributeAt(1);  
        item->ApplyAddon(100);
        item->ChangeAttribute();
        item->AddNewAttr(2, attrtype0, attrtype0prob);
        item->AddNewAttr(3, attrtype1, attrtype1prob);  
        item->AddNewAttr(4, oldattr5type, oldattr5value);

        if (item->GetAttributeType(1) != 71)
        {
            if (item->GetAttributeType(0) != 72)
            {
                item->SetForceAttribute(0, 72, 13);
                item->SetForceAttribute(1, 71, 1);
            }
            else
                item->SetForceAttribute(1, 71, -1);
        }              
    }
   
    ch->RemoveSpecifyItem(40009, 1);
    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_SUCCESS_ATTR"));
}
#endif

Warning - 3
############################
Bu da diğer fileslerle 1-1 aynı olmasına rağmen aldığım hatadan birisi

Adsız507.png

shop.cpp
C++:
void CShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount)
{
    if (bItemCount > SHOP_HOST_ITEM_MAX_NUM)
        return;

    m_pGrid->Clear();

    m_itemVector.resize(SHOP_HOST_ITEM_MAX_NUM);
    memset(&m_itemVector[0], 0, sizeof(SHOP_ITEM) * m_itemVector.size());  /*90.satır*/

    for (int i = 0; i < bItemCount; ++i)
    {
        LPITEM pkItem = NULL;
        const TItemTable* item_table;

shop.h

C++:
class CShop
{
    public:
        typedef struct shop_item     /*15.satır*/
        {
            DWORD    vnum;        // ¾ÆÀÌÅÛ ¹øÈ£
            long long    price;        // °¡°İ
            BYTE    count;        // ¾ÆÀÌÅÛ °³¼ö

            LPITEM    pkItem;
            int        itemid;        // ¾ÆÀÌÅÛ °íÀ¯¾ÆÀ̵ğ

            shop_item()
            {
                vnum = 0;
                price = 0;
                count = 0;
                itemid = 0;
                pkItem = NULL;
            }
        } SHOP_ITEM;

        CShop();
        ~CShop();

        bool    Create(DWORD dwVnum, DWORD dwNPCVnum, TShopItemTable * pItemTable);
 
1-)
iLimitTimerBasedOnWearFlagIndex

Bunun olduğu satırları yorum satırına çevir.

2-)
Gösterdiğin satırda attrtype0 ve targetItempos değişkenlerine = 0 şeklinde değer ver.

3.warning için de çözümü biliyordum ancak hatırlayamadım şu an, PC olmadığı için bakamıyorum maalesef.
 
Geri