From cb8ccdd838b0cc08a1620f1ed9c311d75f1aceba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 3 Mar 2011 21:24:41 +0200 Subject: Add extended buy list items. --- src/net/tmwa/buysellhandler.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index 87b6b8175..bf5df61a1 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -84,8 +84,12 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_NPC_BUY: + { msg.readInt16(); // length - n_items = (msg.getLength() - 4) / 11; + int sz = 11; + if (serverVersion > 0) + sz += 1; + n_items = (msg.getLength() - 4) / sz; mBuyDialog = new BuyDialog(mNpcId); mBuyDialog->setMoney(PlayerInfo::getAttribute(MONEY)); @@ -95,9 +99,14 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg) msg.readInt32(); // DCvalue msg.readInt8(); // type int itemId = msg.readInt16(); + unsigned char color = 1; + if (serverVersion > 0) + color = msg.readInt8(); mBuyDialog->addItem(itemId, 0, value); +// mBuyDialog->addItem(itemId, color, 0, value); } break; + } case SMSG_NPC_SELL: msg.readInt16(); // length -- cgit v1.2.3-70-g09d2