Fix crash when tool has empty times table

This commit is contained in:
Wuzzy 2017-02-11 19:35:39 +01:00
parent dfd7cae20f
commit 74d71cad2a

View File

@ -987,7 +987,7 @@ doc.add_category("tools", {
end
realuses = uses * math.pow(3, maxlevel)
end
if v.times then
if v.times and #v.times > 1 then
for rating, time in pairs(v.times) do
local realtime = time / maxlevel
if mintime == nil or realtime < mintime then