From df8c234def9b3c4b5b0bec41bce182d84307c59a Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 17 Sep 2022 13:55:00 +0200 Subject: [PATCH] Check map limits before get_natural_light --- mods/ENTITIES/mcl_mobs/api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 88d6217ea0..652bb9599f 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1067,7 +1067,10 @@ local do_env_damage = function(self) end end - local sunlight = minetest.get_natural_light(pos, self.time_of_day) + local sunlight = 10 + if within_limits(pos,0) then + sunlight = minetest.get_natural_light(pos, self.time_of_day) + end -- bright light harms mob if self.light_damage ~= 0 and (sunlight or 0) > 12 then