Email: update item slots after sending

This commit is contained in:
CPunch 2023-02-27 19:51:05 -06:00
parent 65a608b478
commit 0c3002c4d9

View File

@ -260,8 +260,18 @@ static void emailSend(CNSocket* sock, CNPacketData* data) {
attSlots.push_back(attachment.iSlotNum); attSlots.push_back(attachment.iSlotNum);
if (real->iOpt == item->iOpt) // delete item (if they attached the whole stack) if (real->iOpt == item->iOpt) // delete item (if they attached the whole stack)
*real = { 0, 0, 0, 0 }; *real = { 0, 0, 0, 0 };
else // otherwise, decrement the item TODO: else // otherwise, decrement the item
real->iOpt -= item->iOpt; real->iOpt -= item->iOpt;
// 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 int cost = pkt->iCash + 50 + 20 * attachments.size(); // attached taros + postage