mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-21 23:56:50 -06:00
Fix small bug when adding entities.
This commit is contained in:
@@ -318,6 +318,10 @@ function tiny.manageEntities(world)
|
|||||||
local filter = sys.filter
|
local filter = sys.filter
|
||||||
if filter then
|
if filter then
|
||||||
local matches = filter(e) and true or nil
|
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
|
local onAdd = sys.onAdd
|
||||||
if onAdd and matches and not es[e] then
|
if onAdd and matches and not es[e] then
|
||||||
onAdd(e)
|
onAdd(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user