From beb043be49c780963834a0602de6308d856a0c10 Mon Sep 17 00:00:00 2001 From: bakpakin Date: Sun, 19 Apr 2015 14:22:51 +0800 Subject: [PATCH] Fix small bug when adding entities. --- tiny.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiny.lua b/tiny.lua index 2c677dc..f248615 100644 --- a/tiny.lua +++ b/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)