summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2014-11-02 21:38:17 +0100
committerLukas Pioch <lukas@zgow.de>2014-11-02 21:38:17 +0100
commit269d76a208fcfc58c3c79d6e6a887b823d4f8f00 (patch)
tree9a89285753fbf89a726e35d4c1857af4b4c3b9d8 /src/World.cpp
parentAdded FindAndDoWithUUID (diff)
downloadcuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar.gz
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar.bz2
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar.lz
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar.xz
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.tar.zst
cuberite-269d76a208fcfc58c3c79d6e6a887b823d4f8f00.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 212566194..1b4f4f171 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -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;
}