summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 71ce7e680..8664bbec6 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -3288,13 +3288,17 @@ void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Resul
for (cPlayerList::iterator itr = m_Players.begin(), end = m_Players.end(); itr != end; ++itr)
{
AString PlayerName ((*itr)->GetName());
+ if ((*itr)->HasCustomName())
+ {
+ PlayerName = (*itr)->GetCustomName();
+ }
+
AString::size_type Found = PlayerName.find(LastWord); // Try to find last word in playername
-
if (Found == AString::npos)
{
continue; // No match
}
-
+
UsernamesByWeight.push_back(std::make_pair(Found, PlayerName)); // Match! Store it with the position of the match as a weight
}
Lock.Unlock();