From 87918db755040bb693cb286d8fb0bcfd97d761af Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 May 2017 17:52:56 +0300 Subject: Remove ServerFeatures haveItemColors because it depend only by server type. --- src/resources/item/item.cpp | 15 +++++++++++---- src/resources/item/shopitem.cpp | 9 ++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/resources') diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp index bc6614e52..6b1f02ecf 100644 --- a/src/resources/item/item.cpp +++ b/src/resources/item/item.cpp @@ -34,6 +34,7 @@ #include "resources/loaders/imageloader.h" +#include "net/net.h" #include "net/serverfeatures.h" #include "utils/delete2.h" @@ -139,10 +140,16 @@ Image *Item::getImage(const int id, std::string Item::getName() const { const ItemInfo &info = ItemDB::get(mId); - if (serverFeatures->haveItemColors()) - return info.getName(mColor); - else +#ifdef TMWA_SUPPORT + if (Net::getNetworkType() == ServerType::TMWATHENA) + { return info.getName(); + } + else +#endif // TWMA_SUPPORT + { + return info.getName(mColor); + } } void Item::setCard(const int index, const int id) @@ -189,6 +196,6 @@ void Item::setOptions(const ItemOptionsList *const options) void Item::updateColor() { - if (serverFeatures && serverFeatures->haveItemColors()) + if (Net::getNetworkType() == ServerType::EATHENA) setId(mId, ItemColorManager::getColorFromCards(&mCards[0])); } diff --git a/src/resources/item/shopitem.cpp b/src/resources/item/shopitem.cpp index 27a496814..55926c46d 100644 --- a/src/resources/item/shopitem.cpp +++ b/src/resources/item/shopitem.cpp @@ -26,6 +26,7 @@ #include "utils/stringutils.h" +#include "net/net.h" #include "net/serverfeatures.h" #include "resources/db/unitsdb.h" @@ -96,10 +97,12 @@ ShopItem::~ShopItem() void ShopItem::updateDisplayName(const int quantity) { - if (serverFeatures->haveItemColors()) - mDisplayName = std::string(getInfo().getName(mColor)); - else +#ifdef TMWA_SUPPORT + if (Net::getNetworkType() == ServerType::TMWATHENA) mDisplayName = std::string(getInfo().getName()); + else +#endif // TMWA_SUPPORT + mDisplayName = std::string(getInfo().getName(mColor)); if (mPrice) { mDisplayName.append(" (").append( -- cgit v1.2.3-70-g09d2