diff options
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index ef1990f8..5142482f 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -78,7 +78,10 @@ void PopupMenu::showPopup(int x, int y, Being *being) if (being->getType() != Being::UNKNOWN) mBrowserBox->addRow(_("@@name|Add name to chat@@")); - const std::string &name = being->getName(); + const std::string &name = being->getType() == Being::NPC ? + being->getName().substr(0, being->getName().size() + - 6) : being->getName(); + switch (being->getType()) { case Being::PLAYER: @@ -304,7 +307,10 @@ void PopupMenu::handleLink(const std::string &link) else if (link == "name" && being) { - chatWindow->addInputText(being->getName()); + const std::string &name = being->getType() == Being::NPC ? + being->getName().substr(0, + being->getName().size() - 6) : being->getName(); + chatWindow->addInputText(name); } else if (link == "admin-kick" && |