Fix bulk_insert not ensuring archetype ids are sorted

This commit is contained in:
1Axen 2025-09-09 05:45:19 +03:00
parent af093713b4
commit f16a176beb
No known key found for this signature in database

View file

@ -2050,7 +2050,9 @@ local function ecs_bulk_insert(world: world, entity: i53, ids: { i53 }, values:
local from = r.archetype
local component_index = world.component_index
if not from then
local dst_types = ids
local dst_types = table.clone(ids)
table.sort(dst_types)
local to = archetype_ensure(world, dst_types)
new_entity(entity, r, to)
local ROOT_ARCHETYPE = world.ROOT_ARCHETYPE