mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
add chunk 'entities' flag
This commit is contained in:
parent
c8666910ce
commit
f4d3e62b3f
4 changed files with 9 additions and 3 deletions
|
|
@ -360,7 +360,7 @@ void WorldRegions::put(Chunk* chunk, std::vector<ubyte> entitiesData){
|
|||
return;
|
||||
}
|
||||
bool lightsUnsaved = !chunk->flags.loadedLights && doWriteLights;
|
||||
if (!chunk->flags.unsaved && !lightsUnsaved) {
|
||||
if (!chunk->flags.unsaved && !lightsUnsaved && !chunk->flags.entities) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +441,11 @@ chunk_inventories_map WorldRegions::fetchInventories(int x, int z) {
|
|||
if (data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return json::from_binary(data, bytesSize);
|
||||
auto map = json::from_binary(data, bytesSize);
|
||||
if (map->size() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
void WorldRegions::processRegionVoxels(int x, int z, const regionproc& func) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue