fix entities clones
This commit is contained in:
parent
3adf97b1b8
commit
e52f08f7de
@ -743,15 +743,14 @@ void Chunks::save(Chunk* chunk) {
|
||||
)
|
||||
);
|
||||
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()) {
|
||||
root = dynamic::create_map();
|
||||
root->put("data", level->entities->serialize(entities));
|
||||
level->entities->despawn(std::move(entities));
|
||||
chunk->flags.entities = true;
|
||||
}
|
||||
worldFiles->getRegions().put(
|
||||
chunk, root ? json::to_binary(root, true) : std::vector<ubyte>()
|
||||
chunk, json::to_binary(root, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user