api: fix nil error in spellduration

This commit is contained in:
shagu
2018-05-26 03:32:41 +02:00
parent 8d8869386f
commit 17a2108253
+4 -1
View File
@@ -109,7 +109,10 @@ function pfUI.api.GetSpellInfo(index, bookType)
local _, _, min = string.find(text:GetText(), gsub(SPELL_CAST_TIME_MIN, "%%.3g", "%(.+%)"))
local _, _, range = string.find(text:GetText(), gsub(SPELL_RANGE, "%%s", "%(.+%)"))
if sec or min then castingTime = tonumber(sec) * 1000 or tonumber(min) * 1000 end
if sec or min then
castingTime = sec and tonumber(sec) * 1000 or tonumber(min) * 1000
end
if range then
local _, _, min, max = string.find(range, "(.+)-(.+)")
if min and max then