mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 20:43:43 +01:00
Only reciprocate damage of valid tool items
This commit is contained in:
parent
7cfd744ff3
commit
20d4728829
@ -318,9 +318,10 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
|
||||
if damage == true and recip == true and hitter and
|
||||
def.reciprocate_damage == true and uses > 0 then
|
||||
local item = hitter:get_wielded_item()
|
||||
local wear = 65535 / uses
|
||||
item:add_wear(wear)
|
||||
if item and item:get_name() ~= "" then
|
||||
item:add_wear(65535 / uses)
|
||||
hitter:set_wielded_item(item)
|
||||
end
|
||||
-- reciprocate tool damage only once
|
||||
recip = false
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user