diff --git a/api.lua b/api.lua index 7c365eb..66c7f42 100644 --- a/api.lua +++ b/api.lua @@ -1002,19 +1002,19 @@ end -- Returns true is node can deal damage to self -function mobs:is_node_dangerous(mob_obj, nodename) +function mobs:is_node_dangerous(mob_object, nodename) - if mob_obj.water_damage > 0 + if mob_object.water_damage > 0 and minetest.get_item_group(nodename, "water") ~= 0 then return true end - if mob_obj.lava_damage > 0 + if mob_object.lava_damage > 0 and minetest.get_item_group(nodename, "lava") ~= 0 then return true end - if mob_obj.fire_damage > 0 + if mob_object.fire_damage > 0 and minetest.get_item_group(nodename, "fire") ~= 0 then return true end @@ -1026,8 +1026,8 @@ function mobs:is_node_dangerous(mob_obj, nodename) return false end -local function is_node_dangerous(mob_obj, nodename) - return mobs:is_node_dangerous(mob_obj, nodename) +local function is_node_dangerous(mob_object, nodename) + return mobs:is_node_dangerous(mob_object, nodename) end