1
0
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:
Buckaroo Banzai 2021-09-29 21:52:58 +02:00 committed by GitHub
parent 8010feb5bf
commit 568944bc87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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