mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
refactor: WorldRegions and chunks saving
This commit is contained in:
parent
f206042b00
commit
c67e4b04bb
8 changed files with 50 additions and 45 deletions
|
|
@ -497,14 +497,9 @@ void Chunks::saveAndClear(){
|
|||
for (size_t i = 0; i < volume; i++){
|
||||
Chunk* chunk = chunks[i].get();
|
||||
chunks[i] = nullptr;
|
||||
if (chunk == nullptr || !chunk->flags.lighted)
|
||||
continue;
|
||||
|
||||
bool lightsUnsaved = !chunk->flags.loadedLights &&
|
||||
worldFiles->doesWriteLights();
|
||||
if (!chunk->flags.unsaved && !lightsUnsaved)
|
||||
continue;
|
||||
regions.put(chunk);
|
||||
if (chunk) {
|
||||
regions.put(chunk);
|
||||
}
|
||||
}
|
||||
chunksCount = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue