viewing paste Unknown #5774 | Diff

Posted on the | Last edited on
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
Index: src/map/clif.c
===================================================================
--- src/map/clif.c  (revision 17304)
+++ src/map/clif.c  (working copy)
@@ -2414,6 +2414,7 @@
 
 void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length)
 {
+   static const int client_buf = 0x5000;
    struct item_data *id;
    int i,n,ne;
    unsigned char *buf;
@@ -2465,27 +2466,33 @@
            n++;
        }
    }
-   if( n )
+   for (i = 0; i < n;)
    {
+       int nn = n - i < (client_buf - 4)/s ? n - i : (client_buf - 4)/s;
+       unsigned char *p = buf + i*s;
+       i += nn;
 #if PACKETVER < 5
-       WBUFW(buf,0)=0xa5;
+       WBUFW(p,0)=0xa5;
 #elif PACKETVER < 20080102
-       WBUFW(buf,0)=0x1f0;
+       WBUFW(p,0)=0x1f0;
 #else
-       WBUFW(buf,0)=0x2ea;
+       WBUFW(p,0)=0x2ea;
 #endif
-       WBUFW(buf,2)=4+n*s;
-       clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+       WBUFW(p,2)=4+nn*s;
+       clif_send(p, WBUFW(p,2), &sd->bl, SELF);
    }
-   if( ne )
+   for (i = 0; i < ne;)
    {
+       int nn = ne - i < (client_buf - 4)/cmd ? ne - i : (client_buf - 4)/cmd;
+       unsigned char *p = bufe + i*cmd;
+       i += nn;
 #if PACKETVER < 20071002
-       WBUFW(bufe,0)=0xa6;
+       WBUFW(p,0)=0xa6;
 #else
-       WBUFW(bufe,0)=0x2d1;
+       WBUFW(p,0)=0x2d1;
 #endif
-       WBUFW(bufe,2)=4+ne*cmd;
-       clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
+       WBUFW(p,2)=4+nn*cmd;
+       clif_send(p, WBUFW(p,2), &sd->bl, SELF);
    }
 
    if( buf ) aFree(buf);
@@ -14068,7 +14075,7 @@
        return;
    }
 
-   if( (item = itemdb_exists(sd->status.inventory[idx].nameid)) != NULL && !(item->type == IT_ARMOR || item->type == IT_PETARMOR || item->type == IT_WEAPON || item->type == IT_CARD || item->type == IT_ETC) )
+   if( (item = itemdb_exists(sd->status.inventory[idx].nameid)) != NULL && itemdb_available(sd->status.inventory[idx].nameid) && !(item->type == IT_ARMOR || item->type == IT_PETARMOR || item->type == IT_WEAPON || item->type == IT_CARD || item->type == IT_ETC) )
    { // Consumable or pets are not allowed
        clif_Auction_setitem(sd->fd, idx, true);
        return;
Viewed 1007 times, submitted by lighta.