]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/mob/api/timers.lua
Add in chicken and chicken eggs
[Crafter.git] / mods / mob / api / timers.lua
index bac10c897f6318f9ae3f56e2535e6588749cc521..82ad6c892bf4b2ad485081edc1152ebc825b94da 100644 (file)
@@ -79,7 +79,8 @@ mobs.create_timer_functions = function(def,mob_register)
                        if self.friendly_in_daylight_timer >= 2 then
                                self.friendly_in_daylight_timer = 0
                                local pos = self.object:get_pos()
-                               if minetest.get_node_light(pos) >= 13 then --1 greater than torch light
+                               local light = minetest.get_node_light(pos)
+                               if pos and light and light >= 13 then --1 greater than torch light
                                        if self.following == false then
                                                self.hostile = false
                                        end