From b08432c9f48ce6a1b669a8ee937aa49d1f16ad35 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 7 Sep 2021 09:57:12 +0200 Subject: [PATCH] libspell: case insensitive max rank detection --- libs/libspell.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/libspell.lua b/libs/libspell.lua index 75150652..43adde51 100644 --- a/libs/libspell.lua +++ b/libs/libspell.lua @@ -16,6 +16,7 @@ local spellmaxrank = {} function libspell.GetSpellMaxRank(name) local cache = spellmaxrank[name] if cache then return cache[1], cache[2] end + local name = string.lower(name) local rank = { 0, nil} for i = 1, GetNumSpellTabs() do @@ -23,7 +24,7 @@ function libspell.GetSpellMaxRank(name) local bookType = BOOKTYPE_SPELL for id = offset + 1, offset + num do local spellName, spellRank = GetSpellName(id, bookType) - if spellName == name then + if name == string.lower(spellName) then if not rank[2] then rank[2] = spellRank end local _, _, numRank = string.find(spellRank, " (%d+)$")