diff options
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/tradehandler.cpp | 37 |
1 files changed, 10 insertions, 27 deletions
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); |