summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-12 12:47:40 +0100
committerWuzzy <almikes@aol.com>2016-12-12 12:47:40 +0100
commit502103acc9578ee94d68d8780840656fab607cfb (patch)
treed42b4860a5c651bd64bd646a08549515e76d275d
parent26cc48a1b2ceece8759c9c7af03d23dff16b2648 (diff)
Fix incorrect category counting
-rw-r--r--init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index f8c7976..97f79b8 100644
--- a/init.lua
+++ b/init.lua
@@ -48,6 +48,7 @@ doc.data = {}
doc.data.categories = {}
-- Default order (includes categories of other mods from the Docuentation System modpack)
doc.data.category_order = {"basics", "nodes", "tools", "craftitems", "advanced"}
+doc.data.category_count = 0
doc.data.players = {}
-- Space for additional APIs
@@ -81,6 +82,7 @@ function doc.new_category(id, def)
else
doc.data.categories[id].order_position = order_id
end
+ doc.data.category_count = doc.data.category_count + 1
return true
else
return false
@@ -336,7 +338,7 @@ end
-- Returns number of categories
function doc.get_category_count()
- return #doc.data.category_order
+ return doc.data.category_count
end
-- Returns number of entries in category