diff options
author | the lemons <citrons@mondecitronne.com> | 2022-08-28 05:36:21 -0500 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2022-08-28 05:36:21 -0500 |
commit | e92131130394e8d9c1454ab4f8538b05a53aeb26 (patch) | |
tree | 7fcc279b251d20756c9eb825132c9042e39d8c52 | |
parent | b76dd15afa3015488b313d516f2a4813334f1855 (diff) |
-rw-r--r-- | world.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -64,12 +64,13 @@ end function obj_proto:remove(ct) local c = assert(self:get(ct)) - for oc in obj:all_components() do - for d in ipairs(oc.deps) do + for oc in self:all_components() do + for _, d in ipairs(oc.deps) do assert(d[1] ~= ct, "dependency") end end - self.world:unreg_component(c) + self.world:registered(self, ct, false) + self.components[ct] = nil if c.disable then c:disable() end if c.remove then c:remove() end end |