summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-09 18:02:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-09 18:02:56 +0300
commit841273fbd5361765b39c7fe8309aa7447b8e79de (patch)
tree25e5e2ab0bc8de3406e545be7055e1ad5e7c0107 /src
parent88d251067ab061177df644dd1acb5c6d74a5e79f (diff)
downloadplus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.gz
plus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.bz2
plus-841273fbd5361765b39c7fe8309aa7447b8e79de.tar.xz
plus-841273fbd5361765b39c7fe8309aa7447b8e79de.zip
eathena: partial fix for packet SMSG_TRADE_ITEM_ADD_RESPONSE 0x00ea.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/tradehandler.cpp37
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);