1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-06-29 23:00:55 +02:00

Respect flammable group when fire is protection enabled

This commit is contained in:
stujones11
2017-04-09 17:34:22 +01:00
parent a76a35f177
commit 7cfd744ff3
5 changed files with 20 additions and 10 deletions

View File

@ -284,7 +284,7 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
local def = stack:get_definition() or {}
if type(def.on_punch) == "function" then
damage = def.on_punch(player, hitter, time_from_last_punch,
tool_capabilities) ~= false
tool_capabilities) ~= false and damage == true
end
if damage == true and tool_capabilities then
local damage_groups = def.damage_groups or default_groups
@ -325,6 +325,9 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
recip = false
end
end
if damage == true and hitter == "fire" then
damage = minetest.get_item_group(name, "flammable") > 0
end
if damage == true then
local old_stack = ItemStack(stack)
stack:add_wear(use)