Fixed an issue with RODEX's retrieve all (#6245)
Sometimes players would not be able to retrieve their items anymore. Thanks to @Balferian and @limitro
This commit is contained in:
parent
cdce54ac0a
commit
d25ec40a8f
@ -290,7 +290,7 @@ void mail_getattachment(struct map_session_data* sd, struct mail_message* msg, i
|
|||||||
|
|
||||||
for( i = 0; i < MAIL_MAX_ITEM; i++ ){
|
for( i = 0; i < MAIL_MAX_ITEM; i++ ){
|
||||||
if( item[i].nameid > 0 && item[i].amount > 0 ){
|
if( item[i].nameid > 0 && item[i].amount > 0 ){
|
||||||
struct item_data* id = itemdb_search( item->nameid );
|
struct item_data* id = itemdb_search( item[i].nameid );
|
||||||
|
|
||||||
// Item does not exist (anymore?)
|
// Item does not exist (anymore?)
|
||||||
if( id == nullptr ){
|
if( id == nullptr ){
|
||||||
@ -316,12 +316,16 @@ void mail_getattachment(struct map_session_data* sd, struct mail_message* msg, i
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
int slots = id->inventorySlotNeeded( item[i].amount );
|
char check = pc_checkadditem( sd, item[i].nameid, item[i].amount );
|
||||||
|
|
||||||
// Add the item normally
|
// Add the item normally
|
||||||
if( pc_additem( sd, &item[i], item[i].amount, LOG_TYPE_MAIL ) == ADDITEM_SUCCESS ){
|
if( check != CHKADDITEM_OVERAMOUNT && pc_additem( sd, &item[i], item[i].amount, LOG_TYPE_MAIL ) == ADDITEM_SUCCESS ){
|
||||||
item_received = true;
|
item_received = true;
|
||||||
sd->mail.pending_slots -= slots;
|
|
||||||
|
// Only reduce slots if it really required a new slot
|
||||||
|
if( check == CHKADDITEM_NEW ){
|
||||||
|
sd->mail.pending_slots -= id->inventorySlotNeeded( item[i].amount );
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
// Do not send receive packet so that the mail is still displayed with item attachment
|
// Do not send receive packet so that the mail is still displayed with item attachment
|
||||||
item_received = false;
|
item_received = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user