X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fchunk.cpp;h=31dfe80b3134bb1a9dea1ba29a4df28c2df317e8;hb=d02daa5a4805dc3184884f3a7cd7620e5787adcb;hp=2d5b7cec853272f1868da71b069760156ab8ca74;hpb=071459d05271dd9376364fc3d8c33bf091724321;p=blank.git diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 2d5b7ce..31dfe80 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -772,6 +772,10 @@ std::list::iterator ChunkLoader::Remove(std::list::iterator chunk) ++next; // unlink neighbors so they won't reference a dead chunk chunk->ClearNeighbors(); + // if it should be saved, do it now + if (chunk->ShouldUpdateSave()) { + save.Write(*chunk); + } // and move it from loaded to free list to_free.splice(to_free.end(), loaded, chunk); return next;