From 77a52b24c88dd113a74ff55cecb63a7214193fdf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Feb 2015 15:08:47 +0300 Subject: Show buy or sell in player context menu based on enabled shop types. --- src/being/being.cpp | 10 ++++++++++ src/being/being.h | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index 97fad3c59..4a3e4d0cb 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3551,3 +3551,13 @@ void Being::enableShop(const bool b) mShop = b; updateName(); } + +bool Being::isBuyShopEnabled() const +{ + return mShop && (!serverFeatures->haveVending() || !mBuyBoard.empty()); +} + +bool Being::isSellShopEnabled() const +{ + return mShop && (!serverFeatures->haveVending() || !mSellBoard.empty()); +} diff --git a/src/being/being.h b/src/being/being.h index a6b588919..12b197a23 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -761,8 +761,9 @@ class Being notfinal : public ActorSprite, void setAdvanced(const bool n) { mAdvanced = n; addToCache(); } - bool isShopEnabled() const A_WARN_UNUSED - { return mShop; } + bool isBuyShopEnabled() const A_WARN_UNUSED; + + bool isSellShopEnabled() const A_WARN_UNUSED; void enableShop(const bool b); -- cgit v1.2.3-70-g09d2