tell if list empty
parent
03010486c8
commit
605727d7ba
3
init.lua
3
init.lua
|
@ -21,7 +21,8 @@ core.register_chatcommand("getinv", {
|
||||||
return true, "Inventories of "..pname..": "..out
|
return true, "Inventories of "..pname..": "..out
|
||||||
end
|
end
|
||||||
local list = inv:get_list(ilist)
|
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
|
for _,stack in ipairs(list) do
|
||||||
local descr = stack:get_description()
|
local descr = stack:get_description()
|
||||||
if descr and descr ~= "" then
|
if descr and descr ~= "" then
|
||||||
|
|
Loading…
Reference in New Issue