mirror of
https://github.com/Ukendio/jecs.git
synced 2025-08-04 11:19:17 +00:00
Compare commits
3 commits
43f9e7bc72
...
b07941ed01
Author | SHA1 | Date | |
---|---|---|---|
|
b07941ed01 | ||
|
24dddee82e | ||
|
74c6a35352 |
2 changed files with 6 additions and 5 deletions
|
@ -60,8 +60,8 @@ world:set(sara, Name, "sara")
|
||||||
|
|
||||||
print(getName(parent(sara)))
|
print(getName(parent(sara)))
|
||||||
|
|
||||||
for e in world:query(pair(ChildOf, alice)) do
|
for e, name in world:query(Name, pair(ChildOf, alice)) do
|
||||||
print(getName(e), "is the child of alice")
|
print(name, "is the child of alice")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Output
|
-- Output
|
||||||
|
|
|
@ -74,11 +74,12 @@ return function(world: types.World)
|
||||||
local removed = map.removed
|
local removed = map.removed
|
||||||
|
|
||||||
if removed then
|
if removed then
|
||||||
for i, e in removed do
|
for _, entity in removed do
|
||||||
if not world:contains(e) then
|
entity = ecs_map_get(world, entity)
|
||||||
|
if not world:contains(entity) then
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
world:remove(e, id)
|
world:remove(entity, id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue