Simplified FindAndDoWithUUID, formatted line
This commit is contained in:
parent
9f71a4e7ae
commit
269d76a208
@ -126,7 +126,7 @@ public:
|
||||
/// Finds a player from a partial or complete player name and calls the callback - case-insensitive
|
||||
bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
|
||||
|
||||
/// Finds a player with the same uuid and call the callback */
|
||||
/// Finds a player with the same uuid and call the callback
|
||||
bool FindAndDoWithUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
|
||||
|
||||
// tolua_begin
|
||||
|
@ -2731,19 +2731,13 @@ bool cWorld::FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCa
|
||||
|
||||
bool cWorld::FindAndDoWithUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback)
|
||||
{
|
||||
cPlayer * FoundPlayer = nullptr;
|
||||
cCSLock Lock(m_CSPlayers);
|
||||
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetUUID() == a_PlayerUUID) { // Match found and exit
|
||||
FoundPlayer = *itr;
|
||||
break;
|
||||
return a_Callback.Item (*itr);
|
||||
}
|
||||
}
|
||||
if (FoundPlayer != nullptr)
|
||||
{
|
||||
return a_Callback.Item (FoundPlayer);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user