summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
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;