summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-03-11 19:01:51 +0100
committerWuzzy <almikes@aol.com>2015-03-11 19:01:51 +0100
commit786d7a7d5d406e0e206062ac168308ec595844de (patch)
tree40d6dacdaa084e6d5de6815d65a0558d35341e94
parent3d816fcb18194563d604cd13a8ec2c3adbb13c43 (diff)
Update entry_list for new category
-rw-r--r--init.lua6
1 files 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