From 7675d495c4a273f3f578ef45a10c44897c50286b Mon Sep 17 00:00:00 2001
From: Auke Kok <sofar@foo-projects.org>
Date: Tue, 7 Feb 2017 19:49:45 -0800
Subject: [PATCH] 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.
---
 src/workbench.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/workbench.lua b/src/workbench.lua
index 79ba691..41c797d 100644
--- a/src/workbench.lua
+++ b/src/workbench.lua
@@ -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)
-- 
GitLab