BUGFIX: Error when invoking 'listitems' without any parameters

master
AntumDeluge 2017-08-01 13:39:51 -07:00
parent d4f84d68bc
commit 46c05fcfec
1 changed files with 5 additions and 5 deletions

10
api.lua
View File

@ -161,11 +161,11 @@ local function formatMatching(player, nlist, params, switches)
-- Use entire list if no parameters supplied
if next(params) == nil then
if not show_descr then
matching = nlist
else
for i, item in ipairs(nlist) do
table.insert(matching, nlist.name .. ' (' .. nlist.descr .. ')')
for i, item in ipairs(nlist) do
if show_descr then
table.insert(matching, item.name .. ' (' .. item.descr .. ')')
else
table.insert(matching, item.name)
end
end
else