From ddee38681e1b4b82218c2932680a8503f5b1e549 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 14 Aug 2024 01:31:56 +0300 Subject: [PATCH] fix: slow world saving --- src/voxels/Chunks.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/voxels/Chunks.cpp b/src/voxels/Chunks.cpp index 86311359..1dbfd5a1 100644 --- a/src/voxels/Chunks.cpp +++ b/src/voxels/Chunks.cpp @@ -750,7 +750,9 @@ void Chunks::save(Chunk* chunk) { chunk->flags.entities = true; } worldFiles->getRegions().put( - chunk, json::to_binary(root, true) + chunk, + chunk->flags.entities ? json::to_binary(root, true) + : std::vector() ); } }