summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-01 17:03:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-02 00:13:44 +0300
commit30f142d6a147885afef203cdc83326cccdb4bb75 (patch)
treedf3a2f37145ce2b2c5a1651d7fb285ae149cda42 /src
parent2464d9d85019711583ef830c2fdeae8a6772cb53 (diff)
downloadplus-30f142d6a147885afef203cdc83326cccdb4bb75.tar.gz
plus-30f142d6a147885afef203cdc83326cccdb4bb75.tar.bz2
plus-30f142d6a147885afef203cdc83326cccdb4bb75.tar.xz
plus-30f142d6a147885afef203cdc83326cccdb4bb75.zip
eathena: Show shop status on seller.
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp15
-rw-r--r--src/being/being.h3
-rw-r--r--src/gui/popups/popupmenu.cpp17
3 files changed, 17 insertions, 18 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 06012f708..170ad3f15 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1891,7 +1891,7 @@ std::string Being::getGenderSign() const
else if (getGender() == Gender::MALE)
str = "\u2642";
}
- if (mShowPlayersStatus && mAdvanced)
+ if (mShowPlayersStatus)
{
if (mShop)
str.append("$");
@@ -2272,7 +2272,8 @@ bool Being::updateFromCache()
if (mAdvanced)
{
const int flags = entry->getFlags();
- mShop = ((flags & BeingFlag::SHOP) != 0);
+ if (!serverFeatures->haveVending())
+ mShop = ((flags & BeingFlag::SHOP) != 0);
mAway = ((flags & BeingFlag::AWAY) != 0);
mInactive = ((flags & BeingFlag::INACTIVE) != 0);
if (mShop || mAway || mInactive)
@@ -2280,7 +2281,8 @@ bool Being::updateFromCache()
}
else
{
- mShop = false;
+ if (!serverFeatures->haveVending())
+ mShop = false;
mAway = false;
mInactive = false;
}
@@ -2324,7 +2326,7 @@ void Being::addToCache() const
if (isAdvanced())
{
int flags = 0;
- if (mShop)
+ if (!serverFeatures->haveVending() && mShop)
flags += BeingFlag::SHOP;
if (mAway)
flags += BeingFlag::AWAY;
@@ -3039,7 +3041,8 @@ void Being::setState(const uint8_t state)
const bool needUpdate = (shop != mShop || away != mAway
|| inactive != mInactive);
- mShop = shop;
+ if (!serverFeatures->haveVending())
+ mShop = shop;
mAway = away;
mInactive = inactive;
updateAwayEffect();
@@ -3530,5 +3533,7 @@ void Being::setChat(ChatObject *const obj)
void Being::setBoard(const std::string &text)
{
+ mShop = !text.empty();
mBoard = text;
+ updateName();
}
diff --git a/src/being/being.h b/src/being/being.h
index 0f6a81413..6453e272d 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -764,9 +764,6 @@ class Being notfinal : public ActorSprite,
bool isShopEnabled() const A_WARN_UNUSED
{ return mShop; }
- void enableShop(const bool b)
- { mShop = b; }
-
/**
* Sets the attack range.
*/
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 5bed32f13..48bb4100c 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2365,17 +2365,14 @@ void PopupMenu::addBuySell(const Being *const being)
if (player_relations.getDefault() & PlayerRelation::TRADE)
{
mBrowserBox->addRow("##3---");
- if (being->isAdvanced())
+ if (being->isShopEnabled())
{
- if (being->isShopEnabled())
- {
- // TRANSLATORS: popup menu item
- // TRANSLATORS: buy item
- mBrowserBox->addRow("/buy 'NAME'", _("Buy"));
- // TRANSLATORS: popup menu item
- // TRANSLATORS: sell item
- mBrowserBox->addRow("/sell 'NAME'", _("Sell"));
- }
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: buy item
+ mBrowserBox->addRow("/buy 'NAME'", _("Buy"));
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: sell item
+ mBrowserBox->addRow("/sell 'NAME'", _("Sell"));
}
else
{