From 3ce7cb63a26dd60b135fb5334a21618a227d22f6 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 1 Jun 2025 14:44:12 +0200 Subject: [PATCH] libspell: skip spell index of invalid spells --- libs/libspell.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/libspell.lua b/libs/libspell.lua index 6176c84f..65298fad 100644 --- a/libs/libspell.lua +++ b/libs/libspell.lua @@ -46,6 +46,7 @@ end -- return: [number],[string] spell index and spellbook id local spellindex = {} function libspell.GetSpellIndex(name, rank) + if not name then return end name = string.lower(name) local cache = spellindex[name..(rank and ("("..rank..")") or "")] if cache then return cache[1], cache[2] end @@ -120,7 +121,7 @@ function libspell.GetSpellInfo(index, bookType) local _, sec = scanner:Find(gsub(SPELL_CAST_TIME_SEC, "%%.3g", "%(.+%)"), false) local _, min = scanner:Find(gsub(SPELL_CAST_TIME_MIN, "%%.3g", "%(.+%)"), false) local _, range = scanner:Find(gsub(SPELL_RANGE, "%%s", "%(.+%)"), false) - + castingTime = (tonumber(sec) or tonumber(min) or 0) * 1000 if range then local _, _, min, max = string.find(range, "(.+)-(.+)")