diff options
Diffstat (limited to 'world.lua')
-rw-r--r-- | world.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -64,8 +64,14 @@ end function obj_proto:remove(ct) local c = assert(self:get(ct)) - self.world:unreg_component(c) - if c.disable then c:disable() end + for oc in obj:all_components() do + for d in ipairs(oc.deps) do + assert(d[1] ~= ct, "dependency") + end + end + self.world:unreg_component(c) + if c.disable then c:disable() end + if c.remove then c:remove() end end function obj_proto:require(ct, instance) |