diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-08-29 15:57:51 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-09-03 17:41:06 +0200 |
commit | 25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef (patch) | |
tree | 9b1c4f92daf3ec5422876bbe4cea604048d90dac /src | |
parent | Configurable dirty unused chunk cap to avoid RAM overuse (#3359) (diff) | |
download | cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar.gz cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar.bz2 cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar.lz cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar.xz cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.tar.zst cuberite-25fa432753d9a60a23e8e84ebe7ef3b3f10d06ef.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Chunk.cpp | 2 | ||||
-rw-r--r-- | src/Chunk.h | 2 | ||||
-rw-r--r-- | src/ChunkMap.cpp | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index d833feea5..508fe355e 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1728,10 +1728,12 @@ void cChunk::SetAlwaysTicked(bool a_AlwaysTicked) if (a_AlwaysTicked) { m_AlwaysTicked += 1; + Stay(a_AlwaysTicked); } else { m_AlwaysTicked -= 1; + Stay(a_AlwaysTicked); } } diff --git a/src/Chunk.h b/src/Chunk.h index 54e4a9502..398d33a5f 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -475,7 +475,7 @@ public: /** Increments (a_AlwaysTicked == true) or decrements (false) the m_AlwaysTicked counter. If the m_AlwaysTicked counter is greater than zero, the chunk is ticked in the tick-thread regardless of - whether it has any clients or not. + whether it has any clients or not. When this is set, the chunk never unloads. This function allows nesting and task-concurrency (multiple separate tasks can request ticking and as long as at least one requests is active the chunk will be ticked). */ void SetAlwaysTicked(bool a_AlwaysTicked); diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index a16b08f15..c8e485cdd 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -2762,7 +2762,7 @@ 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_CSChunks); - cChunkPtr Chunk = GetChunkNoLoad(a_ChunkX, a_ChunkZ); + cChunkPtr Chunk = GetChunk(a_ChunkX, a_ChunkZ); if (Chunk != nullptr) { Chunk->SetAlwaysTicked(a_AlwaysTicked); |