Merge pull request 'ENTITIES/mcl_mobs: Give mobs sunburn at correct light level' (#175) from fix-mobs-burning-in-sunlight into master

Reviewed-on: Mineclonia/Mineclonia#175
Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
cora 2021-11-19 20:27:55 +00:00
commit 71befcff10
1 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,8 @@ local DEFAULT_FALL_SPEED = -10
local FLOP_HEIGHT = 5.0 local FLOP_HEIGHT = 5.0
local FLOP_HOR_SPEED = 1.5 local FLOP_HOR_SPEED = 1.5
local LIGHT_SUN = minetest.LIGHT_MAX + 1
local MOB_CAP = {} local MOB_CAP = {}
MOB_CAP.hostile = 70 MOB_CAP.hostile = 70
MOB_CAP.passive = 10 MOB_CAP.passive = 10
@ -1057,7 +1059,7 @@ local do_env_damage = function(self)
if mod_worlds then if mod_worlds then
_, dim = mcl_worlds.y_to_layer(pos.y) _, dim = mcl_worlds.y_to_layer(pos.y)
end 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 (minetest.get_node_light(pos) or 0) == LIGHT_SUN and dim == "overworld" then
if self.ignited_by_sunlight then if self.ignited_by_sunlight then
mcl_burning.set_on_fire(self.object, 10) mcl_burning.set_on_fire(self.object, 10)
else else