summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r--source/cWorld.cpp9
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;
}