]> git.localhorst.tv Git - blank.git/commitdiff
don't unload dangling chunks until they're saved
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 7 Oct 2015 15:37:14 +0000 (17:37 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 7 Oct 2015 15:37:14 +0000 (17:37 +0200)
src/world/chunk.cpp

index 7ef09c7a465d7f21d2051895af1954c7b62cf342..452e7aa3b3cf23345c7cb1e7f085e3c5d16572c5 100644 (file)
@@ -1012,7 +1012,7 @@ Chunk::Pos ChunkStore::NextMissing() noexcept {
 
 void ChunkStore::Clean() {
        for (auto i = loaded.begin(), end = loaded.end(); i != end;) {
-               if (i->Referenced()) {
+               if (i->Referenced() || i->ShouldUpdateSave()) {
                        ++i;
                } else {
                        auto chunk = i;