Improved formatting of username tabcomplete
This commit is contained in:
parent
217aaca699
commit
8f134adb6d
@ -2931,16 +2931,16 @@ void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Resul
|
|||||||
{
|
{
|
||||||
size_t LastSpace = a_Text.find_last_of(" "); // Find the position of the last space
|
size_t LastSpace = a_Text.find_last_of(" "); // Find the position of the last space
|
||||||
|
|
||||||
std::string LastWord = a_Text.substr(LastSpace + 1, a_Text.length()); //Find the last word
|
AString LastWord = a_Text.substr(LastSpace + 1, a_Text.length()); // Find the last word
|
||||||
std::string PlayerName ((*itr)->GetName());
|
AString PlayerName ((*itr)->GetName());
|
||||||
std::size_t Found = PlayerName.find(LastWord); //Try to find last word in playername
|
size_t Found = PlayerName.find(LastWord); // Try to find last word in playername
|
||||||
|
|
||||||
if (Found!=0)
|
if (Found == AString::npos)
|
||||||
{
|
{
|
||||||
continue; // No match
|
continue; // No match
|
||||||
}
|
}
|
||||||
|
|
||||||
a_Results.push_back((*itr)->GetName()); //Match!
|
a_Results.push_back(PlayerName); // Match!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user