Fixed item removal in RODEX (#4332)

Fixes #4317

Thanks to @voyfmyuh
This commit is contained in:
Lemongrass3110
2019-09-05 23:26:36 +02:00
committed by GitHub
parent 9c05cb8b6f
commit 4664e88b91
2 changed files with 31 additions and 12 deletions

View File

@@ -15874,7 +15874,17 @@ void clif_mail_removeitem( struct map_session_data* sd, bool success, int index,
WFIFOB(fd, 2) = success;
WFIFOW(fd, 3) = index;
WFIFOW(fd, 5) = amount;
WFIFOW(fd, 7) = 0; // TODO: which weight? item weight? removed weight? remaining weight?
int total = 0;
for( int i = 0; i < MAIL_MAX_ITEM; i++ ){
if( sd->mail.item[i].nameid == 0 ){
break;
}
total += sd->mail.item[i].amount * ( sd->inventory_data[sd->mail.item[i].index]->weight / 10 );
}
WFIFOW(fd, 7) = total;
WFIFOSET(fd, 9);
}