From 467ecc7c5883311c2f8bb5e1893ef17f87629f87 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 17 Sep 2022 00:58:03 +0200 Subject: [PATCH] Remove 5.3 check for get_natural_light function as 5.3 isn't supported anymore --- mods/ENTITIES/mcl_mobs/api.lua | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 91c8c6b612..88d6217ea0 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1025,15 +1025,6 @@ local node_ok = function(pos, fallback) return minetest.registered_nodes[fallback] end -local function get_light(pos, tod) - if minetest.get_node_or_nil(pos) then - local lightfunc = minetest.get_natural_light or minetest.get_node_light - return lightfunc(pos, tod) - else - return 0 - end -end - -- environmental damage (water, lava, fire, light etc.) local do_env_damage = function(self) @@ -1076,9 +1067,7 @@ local do_env_damage = function(self) end end - -- Use get_node_light for Minetest version 5.3 where get_natural_light - -- does not exist yet. - local sunlight = get_light(pos, self.time_of_day) + local sunlight = minetest.get_natural_light(pos, self.time_of_day) -- bright light harms mob if self.light_damage ~= 0 and (sunlight or 0) > 12 then