From 8122f3ea9cdb3b3ed400aea918b53ef405fbb614 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 20 Jul 2013 08:46:38 +0000 Subject: [PATCH] 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 --- OvaleBestAction.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 1.7.9.5