From 502103acc9578ee94d68d8780840656fab607cfb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 12 Dec 2016 12:47:40 +0100 Subject: Fix incorrect category counting --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3