summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-01 06:17:59 +0200
committerWuzzy <almikes@aol.com>2016-08-01 06:17:59 +0200
commit0c0b1ccdb4158fbef101f9433b5ae8a51f2c87d8 (patch)
tree87e33cd68cb9d3e7c1c81f24ba699c1804b281ce /init.lua
parent500044d9d26c0fcc40b0c2b20740f12543f2319c (diff)
Tools: Hide maxlevel if missing
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua6
1 files changed, 5 insertions, 1 deletions
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"