+ if def.friendly_in_daylight then
+ mob_register.handle_friendly_in_daylight_timer = function(self,dtime)
+ self.friendly_in_daylight_timer = self.friendly_in_daylight_timer + dtime
+ if self.friendly_in_daylight_timer >= 2 then
+ self.friendly_in_daylight_timer = 0
+ pos = self.object:get_pos()
+ 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
+ else
+ self.hostile = true
+ end
+ end
+ end
+ end
+