From 90f537d6bfb4f794d5721e569ef9ee0c16d38545 Mon Sep 17 00:00:00 2001 From: Cody Young Date: Tue, 21 Mar 2023 00:22:47 -0500 Subject: [PATCH] Stop using metatable it doesn't work --- test-programs/logistics-pipes/pipe_driver.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test-programs/logistics-pipes/pipe_driver.lua b/test-programs/logistics-pipes/pipe_driver.lua index cfd8bdc..118ee92 100644 --- a/test-programs/logistics-pipes/pipe_driver.lua +++ b/test-programs/logistics-pipes/pipe_driver.lua @@ -8,13 +8,15 @@ local driver = {} local ItemStack = {} -function ItemStack.new(item) +local function ItemStack_new(item) checkArg(1, item, "table"); local out = { data = item.getValue1(), quantity = item.getValue2() } - setmetatable(out, ItemStack) + for k,v in pairs(ItemStack) do + out[k] = v + end return out end @@ -43,7 +45,7 @@ function driver.getItems() end local output = {} for _,item in pairs(pipe.getAvailableItems()) do - table.insert(output, ItemStack.new(item)) + table.insert(output, ItemStack_new(item)) end return output end