diff options
author | madmaxoft <github@xoft.cz> | 2014-07-10 18:18:32 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-10 18:18:32 +0200 |
commit | 9e22f46b15d4c92bfbfdd5fb23d7530348f1d534 (patch) | |
tree | 8a5e25dcc2797a066e7d01f2f3d049095062b71e /src/ChunkMap.cpp | |
parent | Merge pull request #1159 from mc-server/VectorFloorFix (diff) | |
download | cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.gz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.bz2 cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.lz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.xz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.zst cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index c9fb0b59e..687c0824f 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -2674,6 +2674,20 @@ void cChunkMap::QueueTickBlock(int a_BlockX, int a_BlockY, int a_BlockZ) +void cChunkMap::SetChunkAlwaysTicked(int a_ChunkX, int a_ChunkZ, bool a_AlwaysTicked) +{ + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunkNoLoad(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ); + if (Chunk != NULL) + { + Chunk->SetAlwaysTicked(a_AlwaysTicked); + } +} + + + + + //////////////////////////////////////////////////////////////////////////////// // cChunkMap::cChunkLayer: @@ -2788,12 +2802,14 @@ void cChunkMap::cChunkLayer::SpawnMobs(cMobSpawner& a_MobSpawner) + + void cChunkMap::cChunkLayer::Tick(float a_Dt) { for (size_t i = 0; i < ARRAYCOUNT(m_Chunks); i++) { - // Only tick chunks that are valid and have clients: - if ((m_Chunks[i] != NULL) && m_Chunks[i]->IsValid() && m_Chunks[i]->HasAnyClients()) + // Only tick chunks that are valid and should be ticked: + if ((m_Chunks[i] != NULL) && m_Chunks[i]->IsValid() && m_Chunks[i]->ShouldBeTicked()) { m_Chunks[i]->Tick(a_Dt); } |