From 605727d7ba4dd56c628096d122ac8ac10d6126bf Mon Sep 17 00:00:00 2001 From: Zemtzov7 <72821250+zmv7@users.noreply.github.com> Date: Sat, 27 Aug 2022 18:41:25 +0500 Subject: [PATCH] tell if list empty --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 24c3f20..042edd6 100644 --- a/init.lua +++ b/init.lua @@ -21,7 +21,8 @@ core.register_chatcommand("getinv", { return true, "Inventories of "..pname..": "..out end local list = inv:get_list(ilist) - if not list then return false, "List not exists" end + local isempty = inv:is_empty(ilist) + if not list or isempty == true then return false, "List not exists or empty" end for _,stack in ipairs(list) do local descr = stack:get_description() if descr and descr ~= "" then