mirror of
https://github.com/OgelGames/fakelib.git
synced 2025-01-04 23:30:35 +01:00
check list size is greater than zero
This commit is contained in:
parent
8f16ad9dd9
commit
3094965807
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user