summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-05-24 02:29:28 +0300
committerJared Adams <jaxad0127@gmail.com>2010-05-24 12:59:53 -0600
commit98820e79e786f3d318a45e0f8e6100841530ff50 (patch)
tree2ea5e02d7320881b523303bd789406ac5fbfc0f8 /src/being.cpp
parent698620d703fea6d572c967bfa746d475d28f2d81 (diff)
downloadmana-98820e79e786f3d318a45e0f8e6100841530ff50.tar.gz
mana-98820e79e786f3d318a45e0f8e6100841530ff50.tar.bz2
mana-98820e79e786f3d318a45e0f8e6100841530ff50.tar.xz
mana-98820e79e786f3d318a45e0f8e6100841530ff50.zip
Show selected target with bold font.
Also fix possible memory corruption. Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/being.cpp b/src/being.cpp
index fd3561ae..0e09126d 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -122,11 +122,14 @@ Being::Being(int id, Type type, int subtype, Map *map):
Being::~Being()
{
+ config.removeListener("visiblenames", this);
+
delete mSpeechBubble;
delete mDispName;
delete mText;
-
- config.removeListener("visiblenames", this);
+ mSpeechBubble = 0;
+ mDispName = 0;
+ mText = 0;
}
void Being::setSubtype(Uint16 subtype)
@@ -1004,8 +1007,15 @@ void Being::showName()
}
}
+ gcn::Font *font = 0;
+ if (player_node && player_node->getTarget() == this
+ && getType() != MONSTER)
+ {
+ font = boldFont;
+ }
+
mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(),
- gcn::Graphics::CENTER, mNameColor);
+ gcn::Graphics::CENTER, mNameColor, font);
updateCoords();
}