mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 12:43:42 +01:00
add nil check in armor.damage
This commit is contained in:
parent
dfa19cce98
commit
fed2087238
@ -631,6 +631,9 @@ end
|
||||
armor.damage = function(self, player, index, stack, use)
|
||||
local old_stack = ItemStack(stack)
|
||||
local worn_armor = armor:get_weared_armor_elements(player)
|
||||
if not worn_armor then
|
||||
return
|
||||
end
|
||||
local armor_worn_cnt = 0
|
||||
for k,v in pairs(worn_armor) do
|
||||
armor_worn_cnt = armor_worn_cnt + 1
|
||||
|
Loading…
Reference in New Issue
Block a user