From cd7415bd8ec7f9dc1ec91edbe052df97a7f644bf Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 25 Oct 2008 16:45:50 +0000 Subject: 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. --- src/npc.cpp | 6 ++++-- 1 file 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 -- cgit v1.2.3-70-g09d2