diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-15 18:09:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-15 18:28:12 +0300 |
commit | ada1a2756824d80ee004d1c1dcbcaba3ce34d2af (patch) | |
tree | fb955ddb69bac7b41e07e22a93aeba95df09164d /src/net/eathena | |
parent | d8da9ebe28dc38fa9c7e5bd859913faa4460a25d (diff) | |
download | plus-ada1a2756824d80ee004d1c1dcbcaba3ce34d2af.tar.gz plus-ada1a2756824d80ee004d1c1dcbcaba3ce34d2af.tar.bz2 plus-ada1a2756824d80ee004d1c1dcbcaba3ce34d2af.tar.xz plus-ada1a2756824d80ee004d1c1dcbcaba3ce34d2af.zip |
eathena: impliment selling item to buying store.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 11 | ||||
-rw-r--r-- | src/net/eathena/buyingstorehandler.h | 3 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 7f2627a29..cca75ce78 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -310,19 +310,20 @@ void BuyingStoreHandler::open(const Being *const being) const void BuyingStoreHandler::sell(const Being *const being, const int storeId, - const int index, - const int itemId, + const Item *const item, const int amount) const { if (!being) return; createOutPacket(CMSG_BUYINGSTORE_SELL); - outMsg.writeInt16(16, "len"); + outMsg.writeInt16(18, "len"); outMsg.writeInt32(being->getId(), "account id"); outMsg.writeInt32(storeId, "store id"); - outMsg.writeInt16(static_cast<int16_t>(index), "index"); - outMsg.writeInt16(static_cast<int16_t>(itemId), "item id"); + outMsg.writeInt16(static_cast<int16_t>( + item->getInvIndex() + INVENTORY_OFFSET), + "index"); + outMsg.writeInt16(static_cast<int16_t>(item->getId()), "item id"); outMsg.writeInt16(static_cast<int16_t>(amount), "amount"); } diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index f48373f03..123ae135e 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -48,8 +48,7 @@ class BuyingStoreHandler final : public MessageHandler, void sell(const Being *const being, const int storeId, - const int index, - const int itemId, + const Item *const item, const int amount) const override final; protected: |