Fixed case comparison - used the builtin function
git-svn-id: http://mc-server.googlecode.com/svn/trunk@663 0a769ca7-a7f5-676a-18bf-c427514a06d6master
parent
f4b66cbbdb
commit
8af0df4309
|
@ -200,15 +200,3 @@ public:
|
|||
|
||||
|
||||
|
||||
//Common functions
|
||||
//Taken from http://stackoverflow.com/questions/11635/case-insensitive-string-comparison-in-c
|
||||
inline bool iequals(const std::string& a, const std::string& b)
|
||||
{
|
||||
unsigned int sz = a.size();
|
||||
if (b.size() != sz)
|
||||
return false;
|
||||
for (unsigned int i = 0; i < sz; ++i)
|
||||
if (tolower(a[i]) != tolower(b[i]))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1534,7 +1534,7 @@ bool cWorld::DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_
|
|||
cCSLock Lock(m_CSPlayers);
|
||||
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
if (iequals((*itr)->GetName(), a_PlayerName))
|
||||
if (NoCaseCompare((*itr)->GetName(), a_PlayerName) == 0)
|
||||
{
|
||||
a_Callback.Item(*itr);
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue