summaryrefslogtreecommitdiff
path: root/src/net/tmwa/buysellhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 20:22:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 20:22:52 +0300
commit36bf685462f371b306f51a29331e7a1d86ce3a91 (patch)
tree79ef1ffdb59524f9fec7ce2dcb3e1cf7f490c70f /src/net/tmwa/buysellhandler.cpp
parentd54c371ad9d3c8a019d7d6bdc0262cd352a06ae5 (diff)
downloadplus-36bf685462f371b306f51a29331e7a1d86ce3a91.tar.gz
plus-36bf685462f371b306f51a29331e7a1d86ce3a91.tar.bz2
plus-36bf685462f371b306f51a29331e7a1d86ce3a91.tar.xz
plus-36bf685462f371b306f51a29331e7a1d86ce3a91.zip
add server feature haveItemColors.
Diffstat (limited to 'src/net/tmwa/buysellhandler.cpp')
-rw-r--r--src/net/tmwa/buysellhandler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 2c8414a1c..2bb2788f6 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -29,6 +29,9 @@
#include "gui/windows/buydialog.h"
+#include "net/net.h"
+#include "net/serverfeatures.h"
+
#include "net/tmwa/protocol.h"
#include "resources/notifytypes.h"
@@ -94,7 +97,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
{
msg.readInt16("len");
unsigned int sz = 11;
- if (serverVersion > 0)
+ if (Net::getServerFeatures()->haveItemColors())
sz += 1;
const unsigned int n_items = (msg.getLength() - 4U) / sz;
mBuyDialog = new BuyDialog(mNpcId);
@@ -107,7 +110,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
msg.readUInt8("type");
const int itemId = msg.readInt16("item id");
uint8_t color = 1;
- if (serverVersion > 0)
+ if (Net::getServerFeatures()->haveItemColors())
color = msg.readUInt8("item color");
mBuyDialog->addItem(itemId, color, 0, value);
}