From ada1a2756824d80ee004d1c1dcbcaba3ce34d2af Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Feb 2015 18:09:18 +0300 Subject: eathena: impliment selling item to buying store. --- src/net/eathena/buyingstorehandler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/net/eathena/buyingstorehandler.cpp') 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(index), "index"); - outMsg.writeInt16(static_cast(itemId), "item id"); + outMsg.writeInt16(static_cast( + item->getInvIndex() + INVENTORY_OFFSET), + "index"); + outMsg.writeInt16(static_cast(item->getId()), "item id"); outMsg.writeInt16(static_cast(amount), "amount"); } -- cgit v1.2.3-70-g09d2