From 9c1c9e8e05a00779f93fc526189c1022805f0a82 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Mon, 21 Apr 2014 05:01:39 +0000 Subject: [PATCH] Return proper IsUsableSpell() value if the name differs from GetSpellInfo. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1297 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleSpellBook.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OvaleSpellBook.lua b/OvaleSpellBook.lua index 78a2c42..dbf890a 100644 --- a/OvaleSpellBook.lua +++ b/OvaleSpellBook.lua @@ -261,8 +261,17 @@ end -- XXX to a proc but the proc replaces the spell in the spellbook, e.g., -- XXX "Aimed Shot" --> "Aimed Shot!". function OvaleSpellBook:IsUsableSpell(spellId) - local name = self:GetSpellName(spellId) - return API_IsUsableSpell(name) or API_IsSpellOverlayed(spellId) + local spellName = self:GetSpellName(spellId) + local result = API_IsUsableSpell(spellName) or API_IsSpellOverlayed(spellId) + if not result then + -- Catch case where the name in the spellbook does not match the GetSpellInfo() name, + -- e.g., druid's Incarnation. + local name = API_GetSpellInfo(spellId) + if name ~= spellName then + result = API_IsUsableSpell(name) + end + end + return result end -- Print out the list of active glyphs in alphabetical order. -- 1.7.9.5