From 0896958465444277fdf5891bdbc4ede53e808db0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Aug 2011 04:13:58 +0300 Subject: Improve drawing invisible npc like arrows or rain. --- src/being.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-60-g2f50