summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-28 22:44:21 +0100
committerWuzzy <almikes@aol.com>2016-12-28 22:44:21 +0100
commit8b6b04c9f04116bee2acb449380a457ded3ddd4a (patch)
treee1b1c13d249d9b024a90613402d62a006428e25f /init.lua
parent30c870ef0bd8ffbaca798fecec942a40212f5ea9 (diff)
Fix dig time being “inf” when maxlevel==0
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 c695604..ca1bb42 100644
--- a/init.lua
+++ b/init.lua
@@ -187,7 +187,11 @@ local factoid_toolcaps = function(tool_capabilities, check_uses)
local maxtime = v.times[rating]
local mintime
local mintimestr, maxtimestr
- mintime = maxtime / maxlevel
+ local maxlevel_calc = maxlevel
+ if maxlevel_calc < 1 then
+ maxlevel_calc = 1
+ end
+ mintime = maxtime / maxlevel_calc
mintimestr = string.format("%.1f", mintime)
maxtimestr = string.format("%.1f", maxtime)
if mintimestr ~= maxtimestr then