if max_light_damage is 16 then use natural light value to damage mob

This commit is contained in:
tenplus1 2023-05-14 10:44:12 +01:00
parent 9c72f0559d
commit 14a3dc83e5
2 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20230502",
version = "20230514",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -381,7 +381,7 @@ function mob_class:set_yaw(yaw, delay)
yaw = 0
end
delay = mob_smooth_rotate and (delay or 0) or 0
delay = mob_smooth_rotate and delay or 0
-- simplified yaw clamp
if yaw > 6.283185 then
@ -1161,8 +1161,8 @@ function mob_class:do_env_damage()
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
-- if max set to 16 then only kill mob with natural sunlight
if self.light_damage_max == 16 then
light = minetest.get_natural_light(pos) or 0
else
light = minetest.get_node_light(pos) or 0

View File

@ -90,7 +90,7 @@ functions needed for the mob to work properly which contains the following:
level is between the min and max values below
'light_damage_min' minimum light value when mob is affected (default: 14)
'light_damage_max' maximum light value when mob is affected (default: 15)
When both set to 15, only kill mob with natural light.
When set to 16 then only natural light will kill mob.
'suffocation' when > 0 mobs will suffocate inside solid blocks and will be
hurt by the value given every second (0 to disable).
'floats' when set to 1 mob will float in water, 0 has them sink.