diff options
author | Ira Rice <irarice@gmail.com> | 2008-10-25 16:45:50 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-10-25 16:45:50 +0000 |
commit | cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf (patch) | |
tree | 9268f43f5edc241b7a34e04577576a83171d5a28 | |
parent | c4a46650d7416b63a6fdcb4b2791839d15ca73d6 (diff) | |
download | mana-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.gz mana-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.bz2 mana-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.xz mana-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.zip |
Changed NPC name logic so that it filters out all content past the #
delimiter. This behavior is specified as being a Safray client feature,
and not being a server feature, and we haven't implemented it before
because of not having a good reason to at the time.
-rw-r--r-- | src/npc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/npc.cpp b/src/npc.cpp index 3f9a1601..5efee873 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -86,10 +86,12 @@ void NPC::setName(const std::string &name) { delete mName; } - mName = new Text(name, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET, + std::string displayName = name.substr(0, name.find('#', 0)); + + mName = new Text(displayName, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET, gcn::Graphics::CENTER, npcNameFont, gcn::Color(200, 200, 255)); - Being::setName(name + " (NPC)"); + Being::setName(displayName + " (NPC)"); } Being::Type |