Check that an item meets usability requirements by calling IsUsableItem().
Johnny C. Lam [05-14-14 - 00:37]
Check that an item meets usability requirements by calling IsUsableItem().
This fixes ticket 314 where Ovale was still suggesting using Synapse
Springs on gloves even after Engineering was dropped as a profession.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1436 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index fac8f31..5542521 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -55,6 +55,7 @@ local API_IsCurrentAction = IsCurrentAction
local API_IsItemInRange = IsItemInRange
local API_IsSpellInRange = IsSpellInRange
local API_IsUsableAction = IsUsableAction
+local API_IsUsableItem = IsUsableItem
local OVALE_DEFAULT_PRIORITY = 3
@@ -834,7 +835,7 @@ function OvaleBestAction:GetActionInfo(element, state)
actionCooldownStart, actionCooldownDuration, actionEnable = API_GetItemCooldown(itemId)
local spellName = API_GetItemSpell(itemId)
- actionUsable = (spellName ~= nil)
+ actionUsable = spellName and API_IsUsableItem(action)
actionType = "item"
actionId = itemId