summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-03 21:24:41 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-03 21:24:41 +0200
commitcb8ccdd838b0cc08a1620f1ed9c311d75f1aceba (patch)
treeb942d4501a9625fc3c50707b06b606058a90fca6 /src/net
parenta9c8a8778611ae67a52469937a178fa2af0f5098 (diff)
downloadmanaverse-cb8ccdd838b0cc08a1620f1ed9c311d75f1aceba.tar.gz
manaverse-cb8ccdd838b0cc08a1620f1ed9c311d75f1aceba.tar.bz2
manaverse-cb8ccdd838b0cc08a1620f1ed9c311d75f1aceba.tar.xz
manaverse-cb8ccdd838b0cc08a1620f1ed9c311d75f1aceba.zip
Add extended buy list items.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/buysellhandler.cpp11
1 files changed, 10 insertions, 1 deletions
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