@@ -613,7 +613,7 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
SqlStmt_BindColumn (stmt, 7 , SQLDT_UINT, &item.expire_time , 0 , NULL , NULL );
SqlStmt_BindColumn (stmt, 8 , SQLDT_UINT, &item.bound , 0 , NULL , NULL );
for ( j = 0 ; j < MAX_SLOTS; ++j )
SqlStmt_BindColumn (stmt, 9 +j, SQLDT_SHORT , &item.card [j], 0 , NULL , NULL );
SqlStmt_BindColumn (stmt, 9 +j, SQLDT_USHORT , &item.card [j], 0 , NULL , NULL );
// bit array indicating which inventory items have already been matched
flag = (bool *) aCalloc (max, sizeof (bool ));
@@ -650,7 +650,7 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
StringBuf_Printf (&buf, " UPDATE `%s ` SET `amount`='%d ', `equip`='%d ', `identify`='%d ', `refine`='%d ',`attribute`='%d ', `expire_time`='%u ', `bound`='%d '" ,
tablename, items[i].amount , items[i].equip , items[i].identify , items[i].refine , items[i].attribute , items[i].expire_time , items[i].bound );
for ( j = 0 ; j < MAX_SLOTS; ++j )
StringBuf_Printf (&buf, " , `card%d `=%d " , j, items[i].card [j]);
StringBuf_Printf (&buf, " , `card%d `=%hu " , j, items[i].card [j]);
StringBuf_Printf (&buf, " WHERE `id`='%d ' LIMIT 1" , item.id );
if ( SQL_ERROR == Sql_QueryStr (sql_handle, StringBuf_Value (&buf)) )
@@ -697,7 +697,7 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
StringBuf_Printf (&buf, " ('%d ', '%hu ', '%d ', '%d ', '%d ', '%d ', '%d ', '%u ', '%d ', '%" PRIu64" '" ,
id, items[i].nameid , items[i].amount , items[i].equip , items[i].identify , items[i].refine , items[i].attribute , items[i].expire_time , items[i].bound , items[i].unique_id );
for ( j = 0 ; j < MAX_SLOTS; ++j )
StringBuf_Printf (&buf, " , '%d '" , items[i].card [j]);
StringBuf_Printf (&buf, " , '%hu '" , items[i].card [j]);
StringBuf_AppendStr (&buf, " )" );
updateLastUid (items[i].unique_id ); // Unique Non Stackable Item ID
@@ -760,7 +760,7 @@ int char_inventory_to_sql(const struct item items[], int max, int id) {
SqlStmt_BindColumn (stmt, 8 , SQLDT_CHAR, &item.favorite , 0 , NULL , NULL );
SqlStmt_BindColumn (stmt, 9 , SQLDT_CHAR, &item.bound , 0 , NULL , NULL );
for ( j = 0 ; j < MAX_SLOTS; ++j )
SqlStmt_BindColumn (stmt, 10 +j, SQLDT_SHORT , &item.card [j], 0 , NULL , NULL );
SqlStmt_BindColumn (stmt, 10 +j, SQLDT_USHORT , &item.card [j], 0 , NULL , NULL );
// bit array indicating which inventory items have already been matched
flag = (bool *) aCalloc (max, sizeof (bool ));
@@ -795,7 +795,7 @@ int char_inventory_to_sql(const struct item items[], int max, int id) {
StringBuf_Printf (&buf, " UPDATE `%s ` SET `amount`='%d ', `equip`='%d ', `identify`='%d ', `refine`='%d ',`attribute`='%d ', `expire_time`='%u ', `favorite`='%d ', `bound`='%d '" ,
schema_config.inventory_db , items[i].amount , items[i].equip , items[i].identify , items[i].refine , items[i].attribute , items[i].expire_time , items[i].favorite , items[i].bound );
for ( j = 0 ; j < MAX_SLOTS; ++j )
StringBuf_Printf (&buf, " , `card%d `=%d " , j, items[i].card [j]);
StringBuf_Printf (&buf, " , `card%d `=%hu " , j, items[i].card [j]);
StringBuf_Printf (&buf, " WHERE `id`='%d ' LIMIT 1" , item.id );
if ( SQL_ERROR == Sql_QueryStr (sql_handle, StringBuf_Value (&buf)) ) {
@@ -838,7 +838,7 @@ int char_inventory_to_sql(const struct item items[], int max, int id) {
StringBuf_Printf (&buf, " ('%d ', '%hu ', '%d ', '%d ', '%d ', '%d ', '%d ', '%u ', '%d ', '%d ', '%" PRIu64" '" ,
id, items[i].nameid , items[i].amount , items[i].equip , items[i].identify , items[i].refine , items[i].attribute , items[i].expire_time , items[i].favorite , items[i].bound , items[i].unique_id );
for ( j = 0 ; j < MAX_SLOTS; ++j )
StringBuf_Printf (&buf, " , '%d '" , items[i].card [j]);
StringBuf_Printf (&buf, " , '%hu '" , items[i].card [j]);
StringBuf_AppendStr (&buf, " )" );
updateLastUid (items[i].unique_id );// Unique Non Stackable Item ID
@@ -1124,7 +1124,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SqlStmt_BindColumn (stmt,10 , SQLDT_ULONGLONG, &tmp_item.unique_id , 0 , NULL , NULL ) )
SqlStmt_ShowDebug (stmt);
for ( i = 0 ; i < MAX_SLOTS; ++i )
if ( SQL_ERROR == SqlStmt_BindColumn (stmt, 11 +i, SQLDT_SHORT , &tmp_item.card [i], 0 , NULL , NULL ) )
if ( SQL_ERROR == SqlStmt_BindColumn (stmt, 11 +i, SQLDT_USHORT , &tmp_item.card [i], 0 , NULL , NULL ) )
SqlStmt_ShowDebug (stmt);
for ( i = 0 ; i < MAX_INVENTORY && SQL_SUCCESS == SqlStmt_NextRow (stmt); ++i )
@@ -1155,7 +1155,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SqlStmt_BindColumn (stmt, 9 , SQLDT_ULONGLONG, &tmp_item.unique_id , 0 , NULL , NULL ) )
SqlStmt_ShowDebug (stmt);
for ( i = 0 ; i < MAX_SLOTS; ++i )
if ( SQL_ERROR == SqlStmt_BindColumn (stmt, 10 +i, SQLDT_SHORT , &tmp_item.card [i], 0 , NULL , NULL ) )
if ( SQL_ERROR == SqlStmt_BindColumn (stmt, 10 +i, SQLDT_USHORT , &tmp_item.card [i], 0 , NULL , NULL ) )
SqlStmt_ShowDebug (stmt);
for ( i = 0 ; i < MAX_CART && SQL_SUCCESS == SqlStmt_NextRow (stmt); ++i )