From 84caed44ff6e4bc9177e9205a183232b34023c84 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 12 Apr 2014 16:20:10 +0000 Subject: [PATCH] Use the correct spell cost when determining usability of a spell. The cost defined in SpellInfo may be adjusted downward based on other parameters, and we should use the adjusted value, not the raw value, when checking whether the spell is able to be cast or not. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1292 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleBestAction.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua index 91985d9..888425a 100644 --- a/OvaleBestAction.lua +++ b/OvaleBestAction.lua @@ -749,10 +749,13 @@ function OvaleBestAction:GetActionInfo(element, state) end end for _, powerType in pairs(OvalePower.SECONDARY_POWER) do - if si[powerType] and si[powerType] > state[powerType] then - -- Spell requires "secondary" resources, e.g., chi, focus, rage, etc., - -- that the player does not have enough of. - return nil + if si[powerType] then + local cost = state:PowerCost(spellId, powerType) + if cost > state[powerType] then + -- Spell requires "secondary" resources, e.g., chi, focus, rage, etc., + -- that the player does not have enough of. + return nil + end end end if actionCooldownStart and actionCooldownDuration then -- 1.7.9.5