mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
fix entities clones
This commit is contained in:
parent
3adf97b1b8
commit
e52f08f7de
1 changed files with 3 additions and 4 deletions
|
|
@ -743,15 +743,14 @@ void Chunks::save(Chunk* chunk) {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
auto entities = level->entities->getAllInside(aabb);
|
auto entities = level->entities->getAllInside(aabb);
|
||||||
dynamic::Map_sptr root = nullptr;
|
auto root = dynamic::create_map();
|
||||||
|
root->put("data", level->entities->serialize(entities));
|
||||||
if (!entities.empty()) {
|
if (!entities.empty()) {
|
||||||
root = dynamic::create_map();
|
|
||||||
root->put("data", level->entities->serialize(entities));
|
|
||||||
level->entities->despawn(std::move(entities));
|
level->entities->despawn(std::move(entities));
|
||||||
chunk->flags.entities = true;
|
chunk->flags.entities = true;
|
||||||
}
|
}
|
||||||
worldFiles->getRegions().put(
|
worldFiles->getRegions().put(
|
||||||
chunk, root ? json::to_binary(root, true) : std::vector<ubyte>()
|
chunk, json::to_binary(root, true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue