viewing paste Unknown #15352 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length) {
    int i = 0;
    struct item_data *id;
 
    do {
        int normal = 0, equip = 0, k = 0;
 
        for( ; i < items_length && k < 500; i++, k++ ) {
 
            if( items[i].nameid <= 0 )
                continue;
 
            id = itemdb->search(items[i].nameid);
 
            if( !itemdb->isstackable2(id) ) //Non-stackable (Equippable)
                clif_item_equip(i+1,&storelist_equip.list[equip++],&items[i],id,id->equip);
            else //Stackable (Normal)
                clif_item_normal(i+1,&storelist_normal.list[normal++],&items[i],id);
        }
 
        if( normal ) {
            storelist_normal.PacketType   = storagelistnormalType;
            storelist_normal.PacketLength =  ( sizeof( storelist_normal ) - sizeof( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal);
 
#if PACKETVER >= 20120925
            safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH);
#endif
 
            clif->send(&storelist_normal, storelist_normal.PacketLength, &sd->bl, SELF);
        }
 
        if( equip ) {
            storelist_equip.PacketType   = storagelistequipType;
            storelist_equip.PacketLength = ( sizeof( storelist_equip ) - sizeof( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip);
 
#if PACKETVER >= 20120925
            safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH);
#endif
 
            clif->send(&storelist_equip, storelist_equip.PacketLength, &sd->bl, SELF);
        }
 
    } while ( i < items_length );
 
}
Viewed 557 times, submitted by Guest.