Quantcast

Check that spell costs are positive before requiring them for spells.

Johnny C. Lam [07-13-14 - 11:31]
Check that spell costs are positive before requiring them for spells.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1546 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index 29d1824..aac04fd 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -266,7 +266,7 @@ local function GetActionSpellInfo(element, state, target)
 			elseif si.combo then
 				-- Spell requires combo points.
 				local cost = state:ComboPointCost(spellId)
-				if state.combo < cost then
+				if cost > 0 and state.combo < cost then
 					Ovale:Logf("Spell ID '%s' requires at least %d combo points.", spellId, cost)
 					meetsRequirements = false
 				end
@@ -275,7 +275,7 @@ local function GetActionSpellInfo(element, state, target)
 					if si[powerType] then
 						-- Spell requires "secondary" resources, e.g., chi, focus, rage, etc.,
 						local cost = state:PowerCost(spellId, powerType)
-						if state[powerType] < cost then
+						if cost > 0 and state[powerType] < cost then
 							Ovale:Logf("Spell ID '%s' requires at least %d %s.", spellId, cost, powerType)
 							meetsRequirements = false
 							break