From 4b8b6a6f887d4cb1dc1ca16e12a47449a9cb4255 Mon Sep 17 00:00:00 2001 From: Justin van der Leij Date: Wed, 7 Mar 2018 11:08:00 +0100 Subject: [PATCH] Reverted a small whoopsie with Entity removal --- fluid/system.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fluid/system.lua b/fluid/system.lua index d3afd2d..98d306c 100644 --- a/fluid/system.lua +++ b/fluid/system.lua @@ -89,6 +89,22 @@ function System:__check(e) end end +--- Removed an Entity from the System. +-- @param e The Entity to remove +function System:__remove(e) + if self:__has(e) then + for _, pool in ipairs(self.__pools) do + if pool:has(e) then + pool:remove(e) + self:entityRemovedFrom(e, pool) + end + end + + self.__all[e] = nil + self:entityRemoved(e) + end +end + --- Tries to add an Entity to the System. -- @param e The Entity to add function System:__tryAdd(e)