Got rid of dangerous GetEntity(), not using DoWithEntity()
git-svn-id: http://mc-server.googlecode.com/svn/trunk@278 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
+4
-5
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user