diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-20 04:13:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-20 04:13:58 +0300 |
commit | 0896958465444277fdf5891bdbc4ede53e808db0 (patch) | |
tree | 663fa6bfe6ffe4a3813cae648db3abe518ae2c9e | |
parent | 8c8ee4ad210289b3c922c1f60c66e5401087d0c1 (diff) | |
download | manaverse-0896958465444277fdf5891bdbc4ede53e808db0.tar.gz manaverse-0896958465444277fdf5891bdbc4ede53e808db0.tar.bz2 manaverse-0896958465444277fdf5891bdbc4ede53e808db0.tar.xz manaverse-0896958465444277fdf5891bdbc4ede53e808db0.zip |
Improve drawing invisible npc like arrows or rain.
-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); |