Fixed serialization bug with duplicate entity ids

This commit is contained in:
2024-10-22 23:38:36 +02:00
parent c2504ec624
commit 74675a4c77
2 changed files with 117 additions and 12 deletions

View File

@@ -54,10 +54,15 @@ load_scene :: (name: string) -> *Scene {
files.allocator = temp;
visit_files(path, true, *files, visitor);
highest : Entity_Id = 0;
for file: files {
deserialize_entity(scene, file.id, file.full_path);
if file.id > highest {
highest = file.id;
}
}
next_entity_id = cast(Entity_Id)(highest + 1);
calculate_aabbs(scene);
make_sure_nothing_collides(scene);