|
@@ -16104,7 +16104,7 @@ void clif_parse_Mail_getattach( int fd, struct map_session_data *sd ){
|
|
|
}
|
|
|
|
|
|
if( attachment&MAIL_ATT_ITEM ){
|
|
|
- int new_ = 0, totalweight = 0;
|
|
|
+ int slots = 0, totalweight = 0;
|
|
|
|
|
|
for( i = 0; i < MAIL_MAX_ITEM; i++ ){
|
|
|
struct item* item = &msg->item[i];
|
|
@@ -16117,7 +16117,7 @@ void clif_parse_Mail_getattach( int fd, struct map_session_data *sd ){
|
|
|
|
|
|
switch( pc_checkadditem(sd, item->nameid, item->amount) ){
|
|
|
case CHKADDITEM_NEW:
|
|
|
- new_++;
|
|
|
+ slots += data->inventorySlotNeeded( item->amount );
|
|
|
break;
|
|
|
case CHKADDITEM_OVERAMOUNT:
|
|
|
clif_mail_getattachment(sd, msg, 2, MAIL_ATT_ITEM);
|
|
@@ -16131,7 +16131,7 @@ void clif_parse_Mail_getattach( int fd, struct map_session_data *sd ){
|
|
|
if( ( totalweight + sd->weight + sd->mail.pending_weight ) > sd->max_weight ){
|
|
|
clif_mail_getattachment(sd, msg, 2, MAIL_ATT_ITEM);
|
|
|
return;
|
|
|
- }else if( pc_inventoryblank(sd) < new_ ){
|
|
|
+ }else if( pc_inventoryblank(sd) < ( slots + sd->mail.pending_slots ) ){
|
|
|
clif_mail_getattachment(sd, msg, 2, MAIL_ATT_ITEM);
|
|
|
return;
|
|
|
}
|
|
@@ -16141,6 +16141,8 @@ void clif_parse_Mail_getattach( int fd, struct map_session_data *sd ){
|
|
|
|
|
|
// Store the pending weight (required for the "retrieve all" feature)
|
|
|
sd->mail.pending_weight += totalweight;
|
|
|
+ // Store the pending slots (required for the "retrieve all" feature)
|
|
|
+ sd->mail.pending_slots += slots;
|
|
|
}
|
|
|
|
|
|
intif_mail_getattach(sd,msg, (enum mail_attachment_type)attachment);
|