Quantcast

Clarify comment on the return value of a node evaluated as a boolean.

Johnny C. Lam [10-15-13 - 01:25]
Clarify comment on the return value of a node evaluated as a boolean.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1049 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index 06b1fde..371d1cf 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -667,9 +667,10 @@ function OvaleBestAction:Compute(element, atTime)
 end

 function OvaleBestAction:ComputeBool(element, atTime)
-	local start, ending, priority, element = self:Compute(element, atTime)
-	--Special case of a value element: it must not be 0
-	if element and element.type == "value" and element.value == 0 and element.rate == 0 then
+	local start, ending, _, newElement = self:Compute(element, atTime)
+	-- Match SimC:0 is false, non-zero is true.
+	--	(https://code.google.com/p/simulationcraft/wiki/ActionLists#Logical_operators)
+	if newElement and newElement.type == "value" and newElement.value == 0 and newElement.rate == 0 then
 		return nil
 	else
 		return start, ending