Jump to content

BUG bonus 6/7 costume and ring


Recommended Posts

Hello i have bug with costume and ring 6/7 bonus its crash the down and my sysserr :

	number_ex: number(): first argument is bigger than second argument 0 -> -1, item_attribute.cpp 418
	

in lign 418

	const TItemAttrTable& r = g_map_itemRare[avail[number(0, avail.size() - 1)]];
	

game.core

	(gdb) bt full
#0  0x081731e9 in CItem::AddRareAttribute (this=0x0) at item_attribute.cpp:418
        i = 679644607
        count = 696344576
        pos = <value optimized out>
        nAttrSet = 696328330
        avail = {<std::_Vector_base<int,std::allocator<int> >> = {
    _M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>}, _M_start = 0x5, _M_finish = 0x28a9977c, _M_end_of_storage = 0x5}}, <No data fields>}
        nAttrLevel = <value optimized out>
        pszIP = <value optimized out>
#1  0x28c5dbe6 in basename_r () from /usr/lib32/libc.so.7
No symbol table info available.
#2  0x083a73ae in CSemaphore::Wait ()
No symbol table info available.
#3  0x083a661d in CAsyncSQL::ChildLoop ()
No symbol table info available.
#4  0x083a6e7e in AsyncSQLThread ()
No symbol table info available.
#5  0x287a8bbc in pthread_condattr_init () from /usr/lib32/libthr.so.3
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.

 

I need your help please

Link to comment
Share on other sites

  • Premium
1 minute ago, Dobrescu Sebastian said:

Change -1 to 1

What? it's not a simple number, it's (avail.size() - 1), if 0 is bigger it means the avail array contains 0 elements for some reason. You must find out why.

 

"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

  • Premium
2 hours ago, Syreldar said:

What? it's not a simple number, it's (avail.size() - 1), if 0 is bigger it means the avail array contains 0 elements for some reason. You must find out why.

I realized it as soon as I read the second line. I edited like in seconds, I don't even know how you got to read so fast.

So AddRareAttribute (this=0x0) , 0x0 it's a nullpointer ? AddRareAttribute + this 0x0  = item null ? 

  • Love 1
Link to comment
Share on other sites

Because i have this code :

in fonction int CItem::GetAttributeSetIndex() in item_attribute.cpp

	if (GetType() == ITEM_RING)
    {
	        return ATTRIBUTE_SET_RING;
    }
	

in fonction enum EAttributeSet in length.h

	ATTRIBUTE_SET_RING
	

in fonction bool CClientManager::InitializeItemAttrTable() in clientmanagerboot.cpp

	bool CClientManager::InitializeItemAttrTable()
{
    char query[4096];
    snprintf(query, sizeof(query),
            "SELECT apply, apply+0, prob, lv1, lv2, lv3, lv4, lv5, weapon, body, wrist, foots, neck, head, shield, ear, ring FROM item_attr%s ORDER BY apply",
            GetTablePostfix());
	    std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
    SQLResult * pRes = pkMsg->Get();
	    if (!pRes->uiNumRows)
    {
        sys_err("no result from item_attr");
        return false;
    }
	    if (!m_vec_itemAttrTable.empty())
    {
        sys_log(0, "RELOAD: item_attr");
        m_vec_itemAttrTable.clear();
    }
	    m_vec_itemAttrTable.reserve(pRes->uiNumRows);
	    MYSQL_ROW    data;
	    while ((data = mysql_fetch_row(pRes->pSQLResult)))
    {
        TItemAttrTable t;
	        memset(&t, 0, sizeof(TItemAttrTable));
	        int col = 0;
	        strlcpy(t.szApply, data[col++], sizeof(t.szApply));
        str_to_number(t.dwApplyIndex, data[col++]);
        str_to_number(t.dwProb, data[col++]);
        str_to_number(t.lValues[0], data[col++]);
        str_to_number(t.lValues[1], data[col++]);
        str_to_number(t.lValues[2], data[col++]);
        str_to_number(t.lValues[3], data[col++]);
        str_to_number(t.lValues[4], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_BODY], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_NECK], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_EAR], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_RING], data[col++]);
	        sys_log(0, "ITEM_ATTR: %-20s %4lu { %3d %3d %3d %3d %3d } { %d %d %d %d %d %d %d }",
                t.szApply,
                t.dwProb,
                t.lValues[0],
                t.lValues[1],
                t.lValues[2],
                t.lValues[3],
                t.lValues[4],
                t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON],
                t.bMaxLevelBySet[ATTRIBUTE_SET_BODY],
                t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST],
                t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS],
                t.bMaxLevelBySet[ATTRIBUTE_SET_NECK],
                t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD],
                t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD],
                t.bMaxLevelBySet[ATTRIBUTE_SET_EAR],
                t.bMaxLevelBySet[ATTRIBUTE_SET_RING]);
	        m_vec_itemAttrTable.push_back(t);
    }
	    return true;
}
	

in fonction bool CClientManager::InitializeItemRareTable() in clientmanagerboot.cpp

	bool CClientManager::InitializeItemRareTable()
{
    char query[4096];
    snprintf(query, sizeof(query),
            "SELECT apply, apply+0, prob, lv1, lv2, lv3, lv4, lv5, weapon, body, wrist, foots, neck, head, shield, ear, ring FROM item_attr_rare%s ORDER BY apply",
            GetTablePostfix());
	    std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
    SQLResult * pRes = pkMsg->Get();
	    if (!pRes->uiNumRows)
    {
        sys_err("no result from item_attr_rare");
        return false;
    }
	    if (!m_vec_itemRareTable.empty())
    {
        sys_log(0, "RELOAD: item_attr_rare");
        m_vec_itemRareTable.clear();
    }
	    m_vec_itemRareTable.reserve(pRes->uiNumRows);
	    MYSQL_ROW    data;
	    while ((data = mysql_fetch_row(pRes->pSQLResult)))
    {
        TItemAttrTable t;
	        memset(&t, 0, sizeof(TItemAttrTable));
	        int col = 0;
	        strlcpy(t.szApply, data[col++], sizeof(t.szApply));
        str_to_number(t.dwApplyIndex, data[col++]);
        str_to_number(t.dwProb, data[col++]);
        str_to_number(t.lValues[0], data[col++]);
        str_to_number(t.lValues[1], data[col++]);
        str_to_number(t.lValues[2], data[col++]);
        str_to_number(t.lValues[3], data[col++]);
        str_to_number(t.lValues[4], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_BODY], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_NECK], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_EAR], data[col++]);
        str_to_number(t.bMaxLevelBySet[ATTRIBUTE_SET_RING], data[col++]);
	        sys_log(0, "ITEM_RARE: %-20s %4lu { %3d %3d %3d %3d %3d } { %d %d %d %d %d %d %d }",
                t.szApply,
                t.dwProb,
                t.lValues[0],
                t.lValues[1],
                t.lValues[2],
                t.lValues[3],
                t.lValues[4],
                t.bMaxLevelBySet[ATTRIBUTE_SET_WEAPON],
                t.bMaxLevelBySet[ATTRIBUTE_SET_BODY],
                t.bMaxLevelBySet[ATTRIBUTE_SET_WRIST],
                t.bMaxLevelBySet[ATTRIBUTE_SET_FOOTS],
                t.bMaxLevelBySet[ATTRIBUTE_SET_NECK],
                t.bMaxLevelBySet[ATTRIBUTE_SET_HEAD],
                t.bMaxLevelBySet[ATTRIBUTE_SET_SHIELD],
                t.bMaxLevelBySet[ATTRIBUTE_SET_EAR]);
	        m_vec_itemRareTable.push_back(t);
    }
	    return true;
}
	

 

in item_length.h after enum ECostumeSubTypes i have add :

	enum ERingSubTypes
{
    RING_PVE,
    RING_PVP,
    RING_NUM_TYPES
};
	

in protoreader.cpp in fonction int get_Item_SubType_Value(int type_value, string inputString) i have add :

	static string arSub33[] = { "RING_PVE", "RING_PVP" };
	and
	arSub33,            //33 ¹ÝÁö
	and
	sizeof(arSub33)/sizeof(arSub33[0]), // 33 ¹ÝÁö
	

in constant after this fonction const int aiArmorSocketQty[ARMOR_NUM_TYPES] =

i have add :

	const int aiRingSocketQty[RING_NUM_TYPES] =
{
    0, // RING_PVE,
    0  // RING_PVP
};
	

and in constant.h after extern const int aiArmorSocketQty[ARMOR_NUM_TYPES];

i have add :

	extern const int aiRingSocketQty[RING_NUM_TYPES];
	

 

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



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