diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-11 17:10:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-11 17:10:52 +0300 |
commit | d3329d1900d306643706478cb2685dec7a1100e4 (patch) | |
tree | 5fe6c480db39a53d43c9f2dee3b1974eeebbdeef /src/net/eathena/mail2handler.cpp | |
parent | a5dc57c1f52878c66ce5548ebe9e0d519cbbfbac (diff) | |
download | manaverse-d3329d1900d306643706478cb2685dec7a1100e4.tar.gz manaverse-d3329d1900d306643706478cb2685dec7a1100e4.tar.bz2 manaverse-d3329d1900d306643706478cb2685dec7a1100e4.tar.xz manaverse-d3329d1900d306643706478cb2685dec7a1100e4.zip |
Add packet CMSG_MAIL2_ADD_ITEM_TO_MAIL 0x0a04.
Diffstat (limited to 'src/net/eathena/mail2handler.cpp')
-rw-r--r-- | src/net/eathena/mail2handler.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp index 550d5f6c1..5d7f50ba3 100644 --- a/src/net/eathena/mail2handler.cpp +++ b/src/net/eathena/mail2handler.cpp @@ -20,10 +20,14 @@ #include "net/eathena/mail2handler.h" +#include "const/net/inventory.h" + #include "net/eathena/messageout.h" #include "net/eathena/updateprotocol.h" #include "net/eathena/protocolout.h" +#include "resources/item/item.h" + #include "debug.h" namespace EAthena @@ -45,4 +49,16 @@ void Mail2Handler::openWriteMail(const std::string &receiver) const outMsg.writeString(receiver, 24, "receiver name"); } +void Mail2Handler::addItem(const Item *const item, + const int amount) const +{ + if (item == nullptr) + return; + + createOutPacket(CMSG_MAIL2_ADD_ITEM_TO_MAIL); + outMsg.writeInt16(CAST_S16( + item->getInvIndex() + INVENTORY_OFFSET), "index"); + outMsg.writeInt16(CAST_S16(amount), "amount"); +} + } // namespace EAthena |