From 786d7a7d5d406e0e206062ac168308ec595844de Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 11 Mar 2015 19:01:51 +0100 Subject: Update entry_list for new category --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 2c85c68..b8bbe0c 100644 --- a/init.lua +++ b/init.lua @@ -52,13 +52,13 @@ function doc.formspec_main() return formstring end -function doc.generate_entry_list(id, playername) +function doc.generate_entry_list(cid, playername) local formstring - if doc.data.players[playername].entry_textlist == nil then + if doc.data.players[playername].entry_textlist == nil or doc.data.players[playername].category ~= cid then local entry_textlist = "textlist[0,1;11,7;doc_catlist;" local counter = 0 doc.data.players[playername].entry_ids = {} - for eid,entry in pairs(doc.data.categories[id].entries) do + for eid,entry in pairs(doc.data.categories[cid].entries) do table.insert(doc.data.players[playername].entry_ids, eid) entry_textlist = entry_textlist .. entry.name .. "," counter = counter + 1 -- cgit v1.2.3