From c7326188fd3cf888c8345a67e308c489da7149f4 Mon Sep 17 00:00:00 2001 From: kilbith Date: Tue, 22 Sep 2015 15:05:45 +0200 Subject: [PATCH] Work Table : fix node put checking since last commit --- worktable.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/worktable.lua b/worktable.lua index 1c2edd1..1153f2a 100644 --- a/worktable.lua +++ b/worktable.lua @@ -96,14 +96,21 @@ function worktable.dig(pos, _) return true end +function worktable.contains(table, element) + for _, value in pairs(table) do + if value == element then return true end + end + return false +end + function worktable.put(_, listname, _, stack, _) local stn = stack:get_name() local count = stack:get_count() - local mat = table.concat(nodes) + local mod, node = stn:match("([%a_]+):([%a_]+)") if listname == "forms" then return 0 end if listname == "input" then - if not mat:match(stn) then return 0 end + if not worktable.contains(nodes[mod], node) then return 0 end end if listname == "hammer" then if stn ~= "xdecor:hammer" then return 0 end