check list size is greater than zero

This commit is contained in:
OgelGames 2024-05-19 15:24:43 +10:00
parent 8f16ad9dd9
commit 3094965807

View File

@ -19,7 +19,7 @@ function fakelib.create_inventory(sizes)
local lists = {} local lists = {}
if type(sizes) == "table" then if type(sizes) == "table" then
for listname, size in pairs(sizes) do for listname, size in pairs(sizes) do
if type(listname) == "string" and type(size) == "number" then if type(listname) == "string" and type(size) == "number" and size > 0 then
local list = {} local list = {}
for i=1, size do for i=1, size do
list[i] = ItemStack() list[i] = ItemStack()