diff --git a/api.lua b/api.lua index 8c90ced..05875d9 100644 --- a/api.lua +++ b/api.lua @@ -95,7 +95,7 @@ function mobs:register_mob(name, def) end local do_env_damage = function(self) - if self.light_damage and self.light_damage ~= 0 and self.object:getpos().y>0 and minetest.env:get_node_light(self.object:getpos()) > 3 then + if self.light_damage and self.light_damage ~= 0 and self.object:getpos().y>0 and minetest.env:get_node_light(self.object:getpos()) and minetest.env:get_node_light(self.object:getpos()) > 3 then self.object:punch(self.object, 1.0, { full_punch_interval=1.0, groupcaps={