summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-20 04:13:58 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-20 04:13:58 +0300
commit0896958465444277fdf5891bdbc4ede53e808db0 (patch)
tree663fa6bfe6ffe4a3813cae648db3abe518ae2c9e /src
parent8c8ee4ad210289b3c922c1f60c66e5401087d0c1 (diff)
downloadplus-0896958465444277fdf5891bdbc4ede53e808db0.tar.gz
plus-0896958465444277fdf5891bdbc4ede53e808db0.tar.bz2
plus-0896958465444277fdf5891bdbc4ede53e808db0.tar.xz
plus-0896958465444277fdf5891bdbc4ede53e808db0.zip
Improve drawing invisible npc like arrows or rain.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp7
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);