From 36bf685462f371b306f51a29331e7a1d86ce3a91 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Sep 2014 20:22:52 +0300 Subject: add server feature haveItemColors. --- src/shopitem.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/shopitem.cpp') diff --git a/src/shopitem.cpp b/src/shopitem.cpp index 45ab60e05..071247483 100644 --- a/src/shopitem.cpp +++ b/src/shopitem.cpp @@ -28,6 +28,9 @@ #include "utils/stringutils.h" +#include "net/net.h" +#include "net/serverfeatures.h" + #include "debug.h" extern int serverVersion; @@ -41,7 +44,7 @@ ShopItem::ShopItem(const int inventoryIndex, const int id, mPrice(price), mShowQuantity(true) { - if (serverVersion > 0) + if (Net::getServerFeatures()->haveItemColors()) { mDisplayName = std::string(getInfo().getName(color)).append(" (") .append(Units::formatCurrency(mPrice)).append(") "); @@ -65,7 +68,7 @@ ShopItem::ShopItem(const int id, const unsigned char color, const int price) : mPrice(price), mShowQuantity(false) { - if (serverVersion > 0) + if (Net::getServerFeatures()->haveItemColors()) { mDisplayName = std::string(getInfo().getName(color)).append(" (") .append(Units::formatCurrency(mPrice)).append(")"); @@ -93,7 +96,7 @@ void ShopItem::update() { if (mShowQuantity) { - if (serverVersion > 0) + if (Net::getServerFeatures()->haveItemColors()) { mDisplayName = std::string(getInfo().getName(mColor)).append(" (") .append(Units::formatCurrency(mPrice)).append(") "); -- cgit v1.2.3-60-g2f50