summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-09-05 15:05:54 +0200
committerMattes D <github@xoft.cz>2016-09-05 15:05:54 +0200
commitf7029eddd4120f672c59a4b3a4395832f4de8863 (patch)
tree81c93ca7c5c03ebdde2401e86dd8c02665710384 /src/Chunk.cpp
parentPluginLua: Removed unneeded assignment. (diff)
parentConfigurable dirty unused chunk cap to avoid RAM overuse (#3359) (diff)
downloadcuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar.gz
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar.bz2
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar.lz
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar.xz
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.tar.zst
cuberite-f7029eddd4120f672c59a4b3a4395832f4de8863.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 06d5eb319..d833feea5 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -223,6 +223,19 @@ bool cChunk::CanUnload(void)
+bool cChunk::CanUnloadAfterSaving(void)
+{
+ return
+ m_LoadedByClient.empty() && // The chunk is not used by any client
+ m_IsDirty && // The chunk is dirty
+ (m_StayCount == 0) && // The chunk is not in a ChunkStay
+ (m_Presence != cpQueued) ; // The chunk is not queued for loading / generating (otherwise multi-load / multi-gen could occur)
+}
+
+
+
+
+
void cChunk::MarkSaving(void)
{
m_IsSaving = true;