From 1c4299ad015847c1e96a4146664a3c4030101427 Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 5 Apr 2018 22:21:14 +0200 Subject: [PATCH] api: fix bad spell caching --- api/spell.lua | 14 ++++++++------ pfUI.toc | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/api/spell.lua b/api/spell.lua index 922b47ce..4cd4ab26 100644 --- a/api/spell.lua +++ b/api/spell.lua @@ -78,7 +78,7 @@ local spellinfo = {} function pfUI.api.GetSpellInfo(index, bookType) if spellinfo[index] then return unpack(spellinfo[index]) end - local name, rank + local name, rank, id local icon = "" local castingTime = 0 local minRange = 0 @@ -88,18 +88,19 @@ function pfUI.api.GetSpellInfo(index, bookType) local _, _, sname, srank = string.find(index, '(.+)%((.+)%)') name = sname or index rank = srank or GetSpellMaxRank(name) - index, bookType = GetSpellIndex(name, rank) + id, bookType = GetSpellIndex(name, rank) else name, rank = GetSpellName(index, bookType) + id, bookType = GetSpellIndex(name, rank) end - if name and index then - texture = GetSpellTexture(index, bookType) + if name and id then + texture = GetSpellTexture(id, bookType) end - if index then + if id then pfSpellScan:ClearLines() - pfSpellScan:SetSpell(index, bookType) + pfSpellScan:SetSpell(id, bookType) for i=1, 4 do for _, text in pairs({_G["pfSpellScanTextLeft"..i], _G["pfSpellScanTextRight"..i]}) do @@ -123,6 +124,7 @@ function pfUI.api.GetSpellInfo(index, bookType) end end end + spellinfo[index] = { name, rank, icon, castingTime, minRange, maxRange } return name, rank, icon, castingTime, minRange, maxRange end diff --git a/pfUI.toc b/pfUI.toc index 8f799971..cfc3b0c6 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccpf|cffffffffUI ## Author: Shagu ## Notes: A complete user interface replacement. -## Version: 3.8.3 +## Version: 3.8.4 ## SavedVariables: pfUI_profiles, pfUI_gold ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB