From 17a210825368a3f52196f277fba545b07b01b692 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 26 May 2018 03:32:41 +0200 Subject: [PATCH] api: fix nil error in spellduration --- api/spell.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/spell.lua b/api/spell.lua index 4cd4ab26..83d40fe9 100644 --- a/api/spell.lua +++ b/api/spell.lua @@ -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