magma damages mobs

This commit is contained in:
Alexander Minges 2020-05-01 11:52:03 +02:00
parent f28dc7312b
commit d0ac1d7377

View file

@ -311,7 +311,7 @@ local is_node_dangerous = function(self, nodename)
end
end
if self.fire_damage > 0 then
if minetest.get_item_group(nn, "fire") ~= 0 then
if (minetest.get_item_group(nn, "fire") ~= 0) or nn == "mcl_nether:magma" then
return true
end
end
@ -855,17 +855,21 @@ local do_env_damage = function(self)
-- fire damage
elseif self.fire_damage > 0
and (nodef.groups.fire) then
and (nodef.groups.fire) or self.standing_on == "mcl_nether:magma" then
if self.fire_damage ~= 0 then
self.health = self.health - self.fire_damage
if self.standing_on ~= "mcl_nether:magma" then
effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
if check_for_death(self, "fire", {type = "environment",
if check_for_death(self, "fire", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
end
elseif check_for_death(self, "water", {type = "environment",
pos = pos, node = self.standing_in}) then
return true
return true
end
end