diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 9 | ||||
-rw-r--r-- | src/being/being.h | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index c5e2ff716..3bb1f9fd5 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -64,6 +64,7 @@ #include "net/serverfeatures.h" #include "resources/attack.h" +#include "resources/chatobject.h" #include "resources/emoteinfo.h" #include "resources/emotesprite.h" #include "resources/iteminfo.h" @@ -174,6 +175,7 @@ Being::Being(const int id, mPets(), mOwner(nullptr), mSpecialParticle(nullptr), + mChat(nullptr), mX(0), mY(0), mSortOffsetY(0), @@ -254,6 +256,7 @@ Being::~Being() delete2(mText); delete2(mEmotionSprite); delete2(mAnimationEffect); + delete2(mChat); if (mOwner) mOwner->unassignPet(this); @@ -3421,3 +3424,9 @@ void Being::recreateItemParticles() } } } + +void Being::setChat(ChatObject *const obj) +{ + delete mChat; + mChat = obj; +} diff --git a/src/being/being.h b/src/being/being.h index ed1127844..a65fb1af0 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -61,6 +61,7 @@ class Party; class SpeechBubble; class Text; +struct ChatObject; struct ParticleInfo; extern volatile int cur_time; @@ -893,6 +894,11 @@ class Being notfinal : public ActorSprite, virtual int getLastAttackY() const { return mLastAttackY; } + void setChat(ChatObject *const obj); + + const ChatObject *getChat() const + { return mChat; } + protected: /** * Updates name's location. @@ -1011,6 +1017,7 @@ class Being notfinal : public ActorSprite, std::vector<Being*> mPets; Being *mOwner; Particle *mSpecialParticle; + ChatObject *mChat; int mX; // position in tiles int mY; // position in tiles |