From 35dff83d93c36cd294f1899b1530da88a80b8917 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Feb 2015 13:22:40 +0300 Subject: Allow to shop buy board name on beings. --- src/being/being.cpp | 10 +++++++++- src/being/being.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/being') 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 mPets; Being *mOwner; -- cgit v1.2.3-60-g2f50