1
0

Changed cBlockHandler->OnUpdate() to use cChunk directly.

This commit is contained in:
madmaxoft
2013-11-30 15:58:27 +01:00
parent 8eae5f2f3a
commit c70c2fa42f
15 changed files with 117 additions and 63 deletions

View File

@@ -2244,7 +2244,24 @@ void cChunkMap::Tick(float a_Dt)
void cChunkMap::UnloadUnusedChunks()
void cChunkMap::TickBlock(int a_BlockX, int a_BlockY, int a_BlockZ)
{
cCSLock Lock(m_CSLayers);
int ChunkX, ChunkZ;
cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ);
cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ZERO_CHUNK_Y, ChunkZ);
if ((Chunk == NULL) || !Chunk->IsValid())
{
return;
}
Chunk->TickBlock(a_BlockX, a_BlockY, a_BlockZ);
}
void cChunkMap::UnloadUnusedChunks(void)
{
cCSLock Lock(m_CSLayers);
for (cChunkLayerList::iterator itr = m_Layers.begin(); itr != m_Layers.end(); ++itr)