mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Use next() instead of one-time loop to fix luacheck warning in mcl_util.calculate_durability
This commit is contained in:
parent
772f48ed58
commit
c57ead6985
1 changed files with 1 additions and 6 deletions
|
@ -456,12 +456,7 @@ function mcl_util.calculate_durability(itemstack)
|
|||
end
|
||||
end
|
||||
end
|
||||
if not uses then
|
||||
for _, v in pairs(itemstack:get_tool_capabilities().groupcaps) do
|
||||
uses = v.uses
|
||||
break
|
||||
end
|
||||
end
|
||||
uses = uses or (next(itemstack:get_tool_capabilities().groupcaps) or {}).uses
|
||||
end
|
||||
|
||||
return uses or 0
|
||||
|
|
Loading…
Reference in a new issue