diff options
-rw-r--r-- | src/being.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp index 7c2a6bf40..d3181c32a 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -476,7 +476,7 @@ void Being::setSpeech(const std::string &text, int time) mSpeech = mSpeech.substr(0, lineLim); trim(mSpeech); - if (mSpeech.length() < 1) + if (mSpeech.empty()) return; if (!time && mSpeech.size() < 200) @@ -1363,7 +1363,7 @@ void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY) void Being::drawSpeech(int offsetX, int offsetY) { - if (!mSpeechBubble) + if (!mSpeechBubble || mSpeech.empty()) return; const int px = getPixelX() - offsetX; @@ -1554,6 +1554,9 @@ void Being::showName() font = gui->getSecureFont(); } + if (mDisplayName.empty()) + return; + mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(), gcn::Graphics::CENTER, mNameColor, font); |