summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-12 02:37:28 +0200
committerarchshift <admin@archshift.com>2014-07-12 02:37:28 +0200
commit83c69134c079ac204c2fda1f375987b9651510d6 (patch)
tree73e02b553e6f3218545d543f587ab25eb918c462 /src/ChunkMap.cpp
parentFor now, removed creator member from Entity Effect for pointer safety (diff)
parentSimplified the player data loading. (diff)
downloadcuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.gz
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.bz2
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.lz
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.xz
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.zst
cuberite-83c69134c079ac204c2fda1f375987b9651510d6.zip
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp20
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);
}