diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-01 17:52:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-01 17:52:56 +0300 |
commit | 87918db755040bb693cb286d8fb0bcfd97d761af (patch) | |
tree | 581d2df22397f829e407d6b5235193e1bf26aac6 /src/resources/item/item.cpp | |
parent | d8e382e49317adf9717d83509c6975f8958f5043 (diff) | |
download | plus-87918db755040bb693cb286d8fb0bcfd97d761af.tar.gz plus-87918db755040bb693cb286d8fb0bcfd97d761af.tar.bz2 plus-87918db755040bb693cb286d8fb0bcfd97d761af.tar.xz plus-87918db755040bb693cb286d8fb0bcfd97d761af.zip |
Remove ServerFeatures haveItemColors because it depend only by server type.
Diffstat (limited to 'src/resources/item/item.cpp')
-rw-r--r-- | src/resources/item/item.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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])); } |