mirror of
https://github.com/lisacvuk/minetest-toolranks.git
synced 2025-01-10 16:00:17 +01:00
check groupcaps[].uses for nil
This commit is contained in:
parent
8010feb5bf
commit
568944bc87
2
init.lua
2
init.lua
@ -122,11 +122,13 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
|
||||
caps.punch_attack_uses = caps.punch_attack_uses and (caps.punch_attack_uses * use_multiplier)
|
||||
|
||||
for _,c in pairs(caps.groupcaps) do
|
||||
if c.uses then
|
||||
c.uses = c.uses * use_multiplier
|
||||
for i,t in ipairs(c.times) do
|
||||
c.times[i] = t / speed_multiplier
|
||||
end
|
||||
end
|
||||
end
|
||||
itemmeta:set_tool_capabilities(caps)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user