Quantcast

Fix ticket 275 - Energy() comparisons

Johnny C. Lam [07-20-13 - 08:46]
Fix ticket 275 - Energy() comparisons

This was a bug in how a "not" node was evaluated -- it was missing the
case where the time interval to invert was {t: t > start}, which should
return {t: t < start}.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@989 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index be18154..3e45e27 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -418,8 +418,16 @@ end
 local function ComputeNot(element)
 	local self = OvaleBestAction
 	local startA, endA = self:ComputeBool(element.a)
-	if startA then
+	--[[
+		NOT start < t < ending    ==>  0 < t < start  OR  ending < t < infinity
+		NOT start < t < infinity  ==>  0 < t < start
+		NOT nil                   ==>  0 < t < infinity
+	]]--
+	if startA and endA then
+		-- TODO: This is not quite right since we ignore 0 < t < startA.
 		return endA, nil
+	elseif startA then
+		return 0, startA
 	else
 		return 0, nil
 	end