summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp10
-rw-r--r--src/being/being.h6
2 files changed, 15 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 60b87914c..97fad3c59 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -175,6 +175,7 @@ Being::Being(const int id,
mSpriteHide(new int[20]),
mSpriteDraw(new int[20]),
mComment(),
+ mBuyBoard(),
mSellBoard(),
mPets(),
mOwner(nullptr),
@@ -3533,11 +3534,18 @@ void Being::setChat(ChatObject *const obj)
void Being::setSellBoard(const std::string &text)
{
- mShop = !text.empty();
+ mShop = !text.empty() || !mBuyBoard.empty();
mSellBoard = text;
updateName();
}
+void Being::setBuyBoard(const std::string &text)
+{
+ mShop = !text.empty() || !mSellBoard.empty();
+ mBuyBoard = text;
+ updateName();
+}
+
void Being::enableShop(const bool b)
{
mShop = b;
diff --git a/src/being/being.h b/src/being/being.h
index e0fd0f044..a6b588919 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -918,6 +918,11 @@ class Being notfinal : public ActorSprite,
std::string getSellBoard() const A_WARN_UNUSED
{ return mSellBoard; }
+ void setBuyBoard(const std::string &text);
+
+ std::string getBuyBoard() const A_WARN_UNUSED
+ { return mBuyBoard; }
+
protected:
/**
* Updates name's location.
@@ -1033,6 +1038,7 @@ class Being notfinal : public ActorSprite,
int *mSpriteHide;
int *mSpriteDraw;
std::string mComment;
+ std::string mBuyBoard;
std::string mSellBoard;
std::vector<Being*> mPets;
Being *mOwner;