diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:20:28 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:20:28 +0100 |
commit | 008addf5d746b2d158f9116e4f6302861b42852f (patch) | |
tree | d569fe2253917ca3dc979c1b5b51d534aa4a538e /source/cWorld.cpp | |
parent | Chunks are now marked as saved (diff) | |
download | cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar.gz cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar.bz2 cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar.lz cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar.xz cuberite-008addf5d746b2d158f9116e4f6302861b42852f.tar.zst cuberite-008addf5d746b2d158f9116e4f6302861b42852f.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cWorld.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 8e95b5bd5..fc6941250 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -1168,18 +1168,17 @@ void cWorld::SendPlayerList(cPlayer * a_DestPlayer) -// TODO: This interface is dangerous!
-cEntity * cWorld::GetEntity( int a_UniqueID )
+bool cWorld::DoWithEntity( int a_UniqueID, cEntityCallback & a_Callback )
{
cCSLock Lock(m_CSEntities);
for (cEntityList::iterator itr = m_AllEntities.begin(); itr != m_AllEntities.end(); ++itr )
{
if( (*itr)->GetUniqueID() == a_UniqueID )
{
- return *itr;
+ return a_Callback.Item(*itr);
}
- }
- return NULL;
+ } // for itr - m_AllEntities[]
+ return false;
}
|