Skip to content
Snippets Groups Projects
Commit 7675d495 authored by Auke Kok's avatar Auke Kok
Browse files

Only Pickaxe is repairable.

Luacheck points out that:

```
Checking src/workbench.lua                        1 warning
    src/workbench.lua:74:2: loop is executed at most once
```

And this is correct, only the pickaxe is actually currently
repairable.

Returned the code to the previous (working) fashion.
parent f3aed9ac
No related branches found
No related tags found
No related merge requests found
......@@ -71,9 +71,10 @@ workbench.defs = {
-- Tools allowed to be repaired
function workbench:repairable(stack)
local tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
for i=1, #tools do
return stack:find(tools[i])
for _, t in pairs(tools) do
if stack:find(t) then return true end
end
return false
end
function workbench:get_output(inv, input, name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment