From 1b57518ca97c670174f89c5af28659b6ad0c3d42 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 27 Feb 2011 03:36:52 +0200 Subject: Implement receiving item color from server. --- src/net/tmwa/tradehandler.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/net/tmwa/tradehandler.cpp') diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 3fb05399d..815c8f54d 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -193,18 +193,23 @@ void TradeHandler::handleMessage(Net::MessageIn &msg) { int amount = msg.readInt32(); int type = msg.readInt16(); - msg.readInt8(); // identified flag + int identify = msg.readInt8(); // identified flag msg.readInt8(); // attribute - msg.readInt8(); // refine + int refine = msg.readInt8(); // refine msg.skip(8); // card (4 shorts) // TODO: handle also identified, etc if (tradeWindow) { if (type == 0) + { tradeWindow->setMoney(amount); + } else - tradeWindow->addItem(type, false, amount, false); + { + tradeWindow->addItem(type, false, amount, refine, + identify, false); + } } } break; @@ -233,7 +238,8 @@ void TradeHandler::handleMessage(Net::MessageIn &msg) if (tradeWindow) { tradeWindow->addItem(item->getId(), true, quantity, - item->isEquipment()); + item->getRefine(), item->getColor(), + item->isEquipment()); } item->increaseQuantity(-quantity); break; -- cgit v1.2.3-70-g09d2