mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2024-10-12 19:44:17 +00:00
Fix small bug when adding entities.
This commit is contained in:
parent
d1e5ad731a
commit
beb043be49
4
tiny.lua
4
tiny.lua
@ -318,6 +318,10 @@ function tiny.manageEntities(world)
|
||||
local filter = sys.filter
|
||||
if filter then
|
||||
local matches = filter(e) and true or nil
|
||||
local onRemove = sys.onRemove
|
||||
if not matches and es[e] and onRemove then
|
||||
onRemove(e)
|
||||
end
|
||||
local onAdd = sys.onAdd
|
||||
if onAdd and matches and not es[e] then
|
||||
onAdd(e)
|
||||
|
Loading…
Reference in New Issue
Block a user