diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-24 23:08:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-24 23:08:40 +0300 |
commit | 50f4daf53d60cfb90107fd4989dd1869bc1f3e35 (patch) | |
tree | b86638cb85d3845d5186563315dd5af5d8e15c50 /src/net/eathena/mail2handler.cpp | |
parent | af5fde1f88bd5c8d0e11b59d73f6c76610c14acf (diff) | |
download | mv-50f4daf53d60cfb90107fd4989dd1869bc1f3e35.tar.gz mv-50f4daf53d60cfb90107fd4989dd1869bc1f3e35.tar.bz2 mv-50f4daf53d60cfb90107fd4989dd1869bc1f3e35.tar.xz mv-50f4daf53d60cfb90107fd4989dd1869bc1f3e35.zip |
Add support for removing item from mail.
Diffstat (limited to 'src/net/eathena/mail2handler.cpp')
-rw-r--r-- | src/net/eathena/mail2handler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp index 1b19e4823..bc749b0bf 100644 --- a/src/net/eathena/mail2handler.cpp +++ b/src/net/eathena/mail2handler.cpp @@ -85,11 +85,9 @@ void Mail2Handler::addItem(const Item *const item, outMsg.writeInt16(CAST_S16(amount), "amount"); } -void Mail2Handler::removeItem(const Item *const item, +void Mail2Handler::removeItem(const int index, const int amount) const { - if (item == nullptr) - return; if (packetVersion < 20140416 || (serverVersion < 19 && serverVersion != 0)) { @@ -97,8 +95,7 @@ void Mail2Handler::removeItem(const Item *const item, } createOutPacket(CMSG_MAIL2_REMOVE_ITEM_MAIL); - outMsg.writeInt16(CAST_S16( - item->getInvIndex() + INVENTORY_OFFSET), "index"); + outMsg.writeInt16(CAST_S16(index + INVENTORY_OFFSET), "index"); outMsg.writeInt16(CAST_S16(amount), "amount"); } |