From 0c0b1ccdb4158fbef101f9433b5ae8a51f2c87d8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 1 Aug 2016 06:17:59 +0200 Subject: Tools: Hide maxlevel if missing --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index ea74d5c..560fa43 100644 --- a/init.lua +++ b/init.lua @@ -112,7 +112,11 @@ local toolcaps_to_text = function(tool_capabilities) if groupcaps ~= nil then formstring = formstring .. "Mining capabilities:\n" for k,v in pairs(groupcaps) do - formstring = formstring .. "- " .. group_to_string(k, "mining") .. ": Level " .. v.maxlevel .. "\n" + local levelstring = "" + if v.maxlevel ~= nil then + levelstring = ": Level "..v.maxlevel + end + formstring = formstring .. "- " .. group_to_string(k, "mining") .. levelstring .. "\n" end end formstring = formstring .. "\n" -- cgit v1.2.3