summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-15 13:22:40 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-15 13:22:40 +0300
commit35dff83d93c36cd294f1899b1530da88a80b8917 (patch)
treec33b40350d3e45a201402982db7925b6c988328e /src/being
parent8ef332195f82d30f70435b69ba485640a19d80ed (diff)
downloadmanaverse-35dff83d93c36cd294f1899b1530da88a80b8917.tar.gz
manaverse-35dff83d93c36cd294f1899b1530da88a80b8917.tar.bz2
manaverse-35dff83d93c36cd294f1899b1530da88a80b8917.tar.xz
manaverse-35dff83d93c36cd294f1899b1530da88a80b8917.zip
Allow to shop buy board name on beings.
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;