summaryrefslogtreecommitdiff
path: root/src/npc.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-10-25 16:45:50 +0000
committerIra Rice <irarice@gmail.com>2008-10-25 16:45:50 +0000
commitcd7415bd8ec7f9dc1ec91edbe052df97a7f644bf (patch)
tree9268f43f5edc241b7a34e04577576a83171d5a28 /src/npc.cpp
parentc4a46650d7416b63a6fdcb4b2791839d15ca73d6 (diff)
downloadmana-client-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.gz
mana-client-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.bz2
mana-client-cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf.tar.xz
mana-client-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.
Diffstat (limited to 'src/npc.cpp')
-rw-r--r--src/npc.cpp6
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