From dbd2ec2270826fce851c2c6050d5b1c5a7675b5a Mon Sep 17 00:00:00 2001 From: CPunch Date: Tue, 28 Feb 2023 15:15:57 -0600 Subject: [PATCH] Email: update the item slots via a ITEM_MOVE_SUCC packet --- src/Email.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Email.cpp b/src/Email.cpp index e787234..3064138 100644 --- a/src/Email.cpp +++ b/src/Email.cpp @@ -260,8 +260,18 @@ static void emailSend(CNSocket* sock, CNPacketData* data) { attSlots.push_back(attachment.iSlotNum); if (real->iOpt <= item->iOpt) // delete item (if they attached the whole stack) *real = { 0, 0, 0, 0 }; - else // otherwise, decrement the item TODO: + else // otherwise, decrement the item real->iOpt -= item->iOpt; + + // HACK: update the slot + INITSTRUCT(sP_FE2CL_PC_ITEM_MOVE_SUCC, itemResp); + itemResp.iFromSlotNum = attachment.iSlotNum; + itemResp.iToSlotNum = attachment.iSlotNum; + itemResp.FromSlotItem = *real; + itemResp.ToSlotItem = *real; + itemResp.eFrom = (int32_t)Items::SlotType::INVENTORY; + itemResp.eTo = (int32_t)Items::SlotType::INVENTORY; + sock->sendPacket(itemResp, P_FE2CL_PC_ITEM_MOVE_SUCC); } int cost = pkt->iCash + 50 + 20 * attachments.size(); // attached taros + postage