Add missing __index

This commit is contained in:
Cody Young 2023-03-21 00:38:25 -05:00
parent 90f537d6bf
commit 14bd08b16c
1 changed files with 2 additions and 3 deletions

View File

@ -7,6 +7,7 @@ local driver = {}
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local ItemStack = {} local ItemStack = {}
ItemStack.__index = ItemStack
local function ItemStack_new(item) local function ItemStack_new(item)
checkArg(1, item, "table"); checkArg(1, item, "table");
@ -14,9 +15,7 @@ local function ItemStack_new(item)
data = item.getValue1(), data = item.getValue1(),
quantity = item.getValue2() quantity = item.getValue2()
} }
for k,v in pairs(ItemStack) do setmetatable(out, ItemStack)
out[k] = v
end
return out return out
end end