1
0

Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually work

git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-06-16 08:35:07 +00:00
parent c4f785e0be
commit ada984facf
8 changed files with 225 additions and 49 deletions

View File

@@ -1473,6 +1473,23 @@ void cChunk::RemoveEntity(cEntity * a_Entity)
bool cChunk::ForEachEntity(cEntityCallback & a_Callback)
{
// The entity list is locked by the parent chunkmap's CS
for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr)
{
if (a_Callback.Item(*itr))
{
return false;
}
} // for itr - m_Entitites[]
return true;
}
BLOCKTYPE cChunk::GetBlock( int a_X, int a_Y, int a_Z )
{
if ((a_X < 0) || (a_X >= Width) || (a_Y < 0) || (a_Y >= Height) || (a_Z < 0) || (a_Z >= Width)) return 0; // Clip