From c697218b55d40137065a809128cdcb2506e67b8a Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 26 May 2018 12:55:12 +0200 Subject: [PATCH] api: fix bad if-condition and tonumber usage --- api/spell.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/spell.lua b/api/spell.lua index 83d40fe9..5b714522 100644 --- a/api/spell.lua +++ b/api/spell.lua @@ -109,9 +109,7 @@ 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 = sec and tonumber(sec) * 1000 or tonumber(min) * 1000 - end + castingTime = tonumber((sec or min or 0)) * 1000 if range then local _, _, min, max = string.find(range, "(.+)-(.+)")