summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 34f6b64ce..2458f33c4 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -500,6 +500,12 @@ void Being::setSpeech(const std::string &text, const std::string &channel,
&userPalette->getColor(UserPalette::PARTICLE),
true);
}
+ else
+ {
+ const bool isShowName = (speech == NAME_IN_BUBBLE);
+ mSpeechBubble->setCaption(isShowName ? mName : "");
+ mSpeechBubble->setText(mSpeech, isShowName);
+ }
}
void Being::takeDamage(Being *const attacker, const int amount,
@@ -1631,14 +1637,10 @@ void Being::drawSpeech(const int offsetX, const int offsetY)
else if (mSpeechTime > 0 && (speech == NAME_IN_BUBBLE ||
speech == NO_NAME_IN_BUBBLE))
{
- const bool isShowName = (speech == NAME_IN_BUBBLE);
-
delete mText;
mText = nullptr;
- mSpeechBubble->setCaption(isShowName ? mName : "");
-
- mSpeechBubble->setText(mSpeech, isShowName);
+ const bool isShowName = (speech == NAME_IN_BUBBLE);
mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() / 2),
py - getHeight() - (mSpeechBubble->getHeight()));
mSpeechBubble->setVisible(true);