diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-09-03 17:38:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-03 17:38:29 +0200 |
commit | 7e9e7f79110e398a4d2b07de3093eaccd551f013 (patch) | |
tree | 96098b99f146a40f42c4322d96fcd061b9548d8a /src/Chunk.cpp | |
parent | Entities now bail out of ticks if destroyed (#3363) (diff) | |
download | cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar.gz cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar.bz2 cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar.lz cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar.xz cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.tar.zst cuberite-7e9e7f79110e398a4d2b07de3093eaccd551f013.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 13 |
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; |