diff --git a/init.lua b/init.lua index bda4da1..2f4bdb6 100644 --- a/init.lua +++ b/init.lua @@ -76,8 +76,8 @@ item_entity.on_step = function(self, dtime, ...) old_on_step(self, dtime, ...) - -- Ignore the item if it should not interact with physics - if not self.physical_state then + -- Ignore the item if it should not interact with physics or was removed + if not self.physical_state or not self.object:is_valid() then return end