summaryrefslogtreecommitdiff
path: root/src/net/tmwa/tradehandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-21 17:43:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-21 17:43:19 +0300
commite3ad003fe09ff90524ffa5deae844e6721b903b2 (patch)
tree756f8cae3ee12060548384ece6750a25bee4ab45 /src/net/tmwa/tradehandler.cpp
parent4ab7d38fe9033695e23042e97b55999b26f00fd7 (diff)
downloadplus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.gz
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.bz2
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.xz
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.zip
Set cards from net code.
Diffstat (limited to 'src/net/tmwa/tradehandler.cpp')
-rw-r--r--src/net/tmwa/tradehandler.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 30b432d2f..5cb9e4ae2 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -170,7 +170,9 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
const uint8_t identify = msg.readUInt8(); // identified flag
msg.readUInt8(); // attribute
const uint8_t refine = msg.readUInt8(); // refine
- msg.skip(8); // card (4 shorts)
+ int cards[4];
+ for (int f = 0; f < 4; f++)
+ cards[f] = msg.readInt16("card");
if (tradeWindow)
{
@@ -182,12 +184,16 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
{
if (serverFeatures->haveItemColors())
{
- tradeWindow->addItem2(type, false, amount,
+ tradeWindow->addItem2(type,
+ cards, 4,
+ false, amount,
refine, identify, true, false, false, false);
}
else
{
- tradeWindow->addItem2(type, false, amount,
+ tradeWindow->addItem2(type,
+ cards, 4,
+ false, amount,
refine, 1, identify != 0, false, false, false);
}
}
@@ -217,8 +223,9 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg)
// Successfully added item
if (tradeWindow)
{
- tradeWindow->addItem2(item->getId(), true,
- quantity, item->getRefine(), item->getColor(),
+ tradeWindow->addItem2(item->getId(),
+ item->getCards(), 4,
+ true, quantity, item->getRefine(), item->getColor(),
item->getIdentified(), item->getDamaged(),
item->getFavorite(), item->isEquipment());
}