From 08054312316cc8b3429dda9919ce51e3f780f427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Tue, 16 Mar 2021 23:48:11 +0100 Subject: [PATCH] Fix #1293 --- mods/ENTITIES/mcl_mobs/api.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index e8ff728d46..7d93f2bad4 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1047,8 +1047,10 @@ local do_env_damage = function(self) end end + local sunlight = minetest.get_natural_light(pos, self.time_of_day) + -- bright light harms mob - if self.light_damage ~= 0 and (minetest.get_node_light(pos) or 0) > 12 then + if self.light_damage ~= 0 and (sunlight or 0) > 12 then if deal_light_damage(self, pos, self.light_damage) then return true end @@ -1057,7 +1059,7 @@ local do_env_damage = function(self) if mod_worlds then _, dim = mcl_worlds.y_to_layer(pos.y) end - if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (minetest.get_node_light(pos) or 0) >= minetest.LIGHT_MAX and dim == "overworld" then + if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (sunlight or 0) >= minetest.LIGHT_MAX and dim == "overworld" then if self.ignited_by_sunlight then mcl_burning.set_on_fire(self.object, 10) else