summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-08-28 05:36:21 -0500
committerthe lemons <citrons@mondecitronne.com>2022-08-28 05:36:21 -0500
commite92131130394e8d9c1454ab4f8538b05a53aeb26 (patch)
tree7fcc279b251d20756c9eb825132c9042e39d8c52
parentb76dd15afa3015488b313d516f2a4813334f1855 (diff)
fix obj:removeHEADmaster
-rw-r--r--world.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/world.lua b/world.lua
index e32938d..3d9c3ae 100644
--- a/world.lua
+++ b/world.lua
@@ -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