Skip to content

Commit

Permalink
check groupcaps[].uses for nil
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Sep 29, 2021
1 parent 8010feb commit 568944b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ 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
c.uses = c.uses * use_multiplier
for i,t in ipairs(c.times) do
c.times[i] = t / speed_multiplier
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)
Expand Down

0 comments on commit 568944b

Please sign in to comment.