]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
allow multiple meshes per entity
[blank.git] / src / world / chunk.cpp
index 2d5b7cec853272f1868da71b069760156ab8ca74..31dfe80b3134bb1a9dea1ba29a4df28c2df317e8 100644 (file)
@@ -772,6 +772,10 @@ std::list<Chunk>::iterator ChunkLoader::Remove(std::list<Chunk>::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;