From 232ab4a4c80f732dc1e27a27463e6e0f5ed361ef Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 15 Oct 2013 03:07:01 +0000 Subject: [PATCH] Fix the return values of BuffExpires and BuffPresent in corner cases. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1063 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCondition.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OvaleCondition.lua b/OvaleCondition.lua index 233fa09..6ab35dd 100644 --- a/OvaleCondition.lua +++ b/OvaleCondition.lua @@ -943,7 +943,11 @@ OvaleCondition.conditions.buffexpires = function(condition) return TestBoolean(true) end Ovale:Logf("timeBefore = %s, ending = %s", timeBefore, ending) - return ending - timeBefore, math.huge + if ending - timeBefore <= start then + return start, math.huge + else + return ending - timeBefore, math.huge + end end OvaleCondition.conditions.debuffexpires = OvaleCondition.conditions.buffexpires @@ -1034,7 +1038,11 @@ OvaleCondition.conditions.buffpresent = function(condition) return nil end local timeBefore = TimeWithHaste(condition[2], condition.haste) - return start, ending - timeBefore + if ending - timeBefore <= start then + return nil + else + return start, ending - timeBefore + end end OvaleCondition.conditions.debuffpresent = OvaleCondition.conditions.buffpresent -- 1.7.9.5