From 841273fbd5361765b39c7fe8309aa7447b8e79de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Oct 2014 18:02:56 +0300 Subject: eathena: partial fix for packet SMSG_TRADE_ITEM_ADD_RESPONSE 0x00ea. --- src/net/eathena/tradehandler.cpp | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) (limited to 'src/net/eathena/tradehandler.cpp') diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index 2b365e12f..da97b7a0a 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -204,32 +204,20 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) { - // Trade: New Item add response (was 0x00ea, now 01b1) - const int index = msg.readInt16() - INVENTORY_OFFSET; - Item *item = nullptr; - if (PlayerInfo::getInventory()) - item = PlayerInfo::getInventory()->getItem(index); - - if (!item) - { - if (tradeWindow) - tradeWindow->receivedOk(true); - return; - } - const int quantity = msg.readInt16(); - - const uint8_t res = msg.readUInt8(); + const int index = msg.readInt16("index") - INVENTORY_OFFSET; + const uint8_t res = msg.readUInt8("fail"); switch (res) { - case 0: - // Successfully added item + case 0: // Successfully added item + case 9: // silent added item if (tradeWindow) { - tradeWindow->addItem2(item->getId(), true, - quantity, item->getRefine(), item->getColor(), - item->isEquipment()); + // here need add cached item +// tradeWindow->addItem2(item->getId(), true, +// quantity, item->getRefine(), item->getColor(), +// item->isEquipment()); } - item->increaseQuantity(-quantity); +// item->increaseQuantity(-quantity); break; case 1: // Add item failed - player overweighted @@ -237,12 +225,7 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) TRADE_ADD_PARTNER_OVER_WEIGHT); break; case 2: - // Add item failed - player has no free slot - NotifyManager::notify(NotifyTypes::TRADE_ADD_PARTNER_NO_SLOTS); - break; - case 3: - // Add item failed - non tradable item - NotifyManager::notify(NotifyTypes::TRADE_ADD_UNTRADABLE_ITEM); + NotifyManager::notify(NotifyTypes::TRADE_ADD_ERROR); break; default: NotifyManager::notify(NotifyTypes::TRADE_ADD_ERROR); -- cgit v1.2.3-60-g2f50