Fix dig time being “inf” when maxlevel==0

master
Wuzzy 2016-12-28 22:44:21 +01:00
parent 30c870ef0b
commit 8b6b04c9f0
1 changed files with 5 additions and 1 deletions

View File

@ -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