mirror of
https://github.com/Ukendio/jecs.git
synced 2025-09-14 04:29:18 +00:00
Inline world_remove
This commit is contained in:
parent
b0e73857b9
commit
549fe97622
1 changed files with 9 additions and 1 deletions
10
jecs.luau
10
jecs.luau
|
@ -2986,9 +2986,17 @@ local function world_new()
|
||||||
end
|
end
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
local on_remove = id_record.on_remove
|
||||||
|
|
||||||
for i = #entities, 1, -1 do
|
for i = #entities, 1, -1 do
|
||||||
local child = entities[i]
|
local child = entities[i]
|
||||||
world_remove(world, child, id)
|
if on_remove then
|
||||||
|
on_remove(child, id)
|
||||||
|
end
|
||||||
|
|
||||||
|
local r = entity_index_try_get_unsafe(child) :: record
|
||||||
|
local to = archetype_traverse_remove(world, id, r.archetype)
|
||||||
|
inner_entity_move(child, r, to)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue