diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-09 18:02:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-09 18:02:56 +0300 |
commit | 841273fbd5361765b39c7fe8309aa7447b8e79de (patch) | |
tree | 25e5e2ab0bc8de3406e545be7055e1ad5e7c0107 /src/net/eathena/tradehandler.cpp | |
parent | 88d251067ab061177df644dd1acb5c6d74a5e79f (diff) | |
download | manaplus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.gz manaplus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.bz2 manaplus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.xz manaplus-841273fbd5361765b39c7fe8309aa7447b8e79de.zip |
eathena: partial fix for packet SMSG_TRADE_ITEM_ADD_RESPONSE 0x00ea.
Diffstat (limited to 'src/net/eathena/tradehandler.cpp')
-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); |