summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-28 19:31:28 +0100
committerWuzzy <almikes@aol.com>2016-12-28 19:31:28 +0100
commitc7d375b65f96b7e43759f4951cce7a6b468fd141 (patch)
tree6c4911a91c5fb820a27c8d5619c5e6cd784db0ad /init.lua
parented13ef49039aca0bdec2a1ea7a1a9e8f5d59fb6c (diff)
Add support for unlimited uses
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 99cbd32..c695604 100644
--- a/init.lua
+++ b/init.lua
@@ -215,7 +215,11 @@ local factoid_toolcaps = function(tool_capabilities, check_uses)
if check_uses and base_uses > 0 then
for level=0, maxlevel do
local real_uses = base_uses * math.pow(3, maxlevel - level)
- miningusesstr = miningusesstr .. S("• @1, level @2: @3 uses", doc.sub.items.get_group_name(k), level, real_uses)
+ if real_uses < 65535 then
+ miningusesstr = miningusesstr .. S("• @1, level @2: @3 uses", doc.sub.items.get_group_name(k), level, real_uses)
+ else
+ miningusesstr = miningusesstr .. S("• @1, level @2: Unlimited", doc.sub.items.get_group_name(k), level)
+ end
miningusesstr = miningusesstr .. "\n"
useslines = useslines + 1
end