From 9a5d4278fff8a9799c4b0097d8ea94b78c62e29a Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 2 May 2023 08:35:12 +0100 Subject: [PATCH] if min/max light set to 15, only kill mob with natural light --- api.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 687bdbc..2de6b0b 100644 --- a/api.lua +++ b/api.lua @@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20230427", + version = "20230502", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -1159,7 +1159,14 @@ function mob_class:do_env_damage() -- is mob light sensitive, or scared of the dark :P if self.light_damage ~= 0 then - local light = minetest.get_node_light(pos) or 0 + local light + + -- if min and max light set to 15 then only kill with natural sunlight + if self.light_damage_min == 15 and self.light_damage_max == 15 then + light = minetest.get_natural_light(pos) or 0 + else + light = minetest.get_node_light(pos) or 0 + end if light >= self.light_damage_min and light <= self.light_damage_max then