1
0

cBlockArea object added (with only minimal testing so far)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@641 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-07-02 16:30:17 +00:00
parent 6b96805f5c
commit bf13084f1f
12 changed files with 1888 additions and 39 deletions

View File

@@ -1165,6 +1165,35 @@ bool cChunkMap::IsChunkLighted(int a_ChunkX, int a_ChunkZ)
bool cChunkMap::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback)
{
bool Result = true;
cCSLock Lock(m_CSLayers);
for (int z = a_MinChunkZ; z <= a_MaxChunkZ; z++)
{
for (int x = a_MinChunkX; x <= a_MaxChunkX; x++)
{
cChunkPtr Chunk = GetChunkNoLoad(x, ZERO_CHUNK_Y, z);
if ((Chunk == NULL) || (!Chunk->IsValid()))
{
// Not present / not valid
Result = false;
continue;
}
if (!a_Callback.Coords(x, z))
{
continue;
}
Chunk->GetAllData(a_Callback);
}
}
return Result;
}
void cChunkMap::GetChunkStats(int & a_NumChunksValid, int & a_NumChunksDirty)
{
a_NumChunksValid = 0;