diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-01 20:11:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-01 20:11:13 +0300 |
commit | d9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1 (patch) | |
tree | cf04cf0aeaaa854eacf8718d80c2ad863c24ebb5 /src/being | |
parent | f06f491e3f9a5c47b98ec136c8eee7789152ce32 (diff) | |
download | plus-d9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1.tar.gz plus-d9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1.tar.bz2 plus-d9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1.tar.xz plus-d9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1.zip |
Remove ServerFeatures haveVending because it depend only on server type.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 17 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index dfb337598..7cfc18760 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3321,8 +3321,11 @@ bool Being::updateFromCache() restrict2 if (mAdvanced) { const int flags = entry->getFlags(); - if (serverFeatures && !serverFeatures->haveVending()) + if (serverFeatures && + Net::getNetworkType() == ServerType::TMWATHENA) + { mShop = ((flags & BeingFlag::SHOP) != 0); + } mAway = ((flags & BeingFlag::AWAY) != 0); mInactive = ((flags & BeingFlag::INACTIVE) != 0); if (mShop || mAway || mInactive) @@ -3330,7 +3333,7 @@ bool Being::updateFromCache() restrict2 } else { - if (serverFeatures && !serverFeatures->haveVending()) + if (Net::getNetworkType() == ServerType::TMWATHENA) mShop = false; mAway = false; mInactive = false; @@ -3379,7 +3382,7 @@ void Being::addToCache() const restrict2 if (isAdvanced()) { int flags = 0; - if (serverFeatures && !serverFeatures->haveVending() && mShop) + if (Net::getNetworkType() == ServerType::TMWATHENA && mShop) flags += BeingFlag::SHOP; if (mAway) flags += BeingFlag::AWAY; @@ -4613,7 +4616,7 @@ void Being::setState(const uint8_t state) restrict2 const bool needUpdate = (shop != mShop || away != mAway || inactive != mInactive); - if (!serverFeatures->haveVending()) + if (Net::getNetworkType() == ServerType::TMWATHENA) mShop = shop; mAway = away; mInactive = inactive; @@ -5133,12 +5136,14 @@ void Being::enableShop(const bool b) restrict2 bool Being::isBuyShopEnabled() const restrict2 { - return mShop && (!serverFeatures->haveVending() || !mBuyBoard.empty()); + return mShop && (Net::getNetworkType() == ServerType::TMWATHENA || + !mBuyBoard.empty()); } bool Being::isSellShopEnabled() const restrict2 { - return mShop && (!serverFeatures->haveVending() || !mSellBoard.empty()); + return mShop && (Net::getNetworkType() == ServerType::TMWATHENA || + !mSellBoard.empty()); } void Being::serverRemove() restrict2 noexcept2 diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 81eb8f2c1..df69ffb38 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -2755,7 +2755,7 @@ void LocalPlayer::updateStatus() const if (serverFeatures->havePlayerStatusUpdate() && mEnableAdvert) { uint8_t status = 0; - if (!serverFeatures->haveVending()) + if (Net::getNetworkType() == ServerType::TMWATHENA) { if (mTradebot && shopWindow && !shopWindow->isShopEmpty()) status |= BeingFlag::SHOP; |