From b480dde0317264372d7157a073b68b71c8fbd66b Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Thu, 8 May 2014 17:25:35 +0000 Subject: [PATCH] Split out comparator names into a public table for conditions to access. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1392 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCondition.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OvaleCondition.lua b/OvaleCondition.lua index 36656b6..63105ce 100644 --- a/OvaleCondition.lua +++ b/OvaleCondition.lua @@ -77,6 +77,14 @@ OvaleCondition.ParseCondition = nil OvaleCondition.ParseRuneCondition = nil OvaleCondition.TestBoolean = nil OvaleCondition.TestValue = nil + +OvaleCondition.COMPARATOR = { + atLeast = true, + atMost = true, + equal = true, + less = true, + more = true, +} -- -- @@ -202,9 +210,8 @@ OvaleCondition.TestValue = function(start, ending, value, origin, rate, comparat else return 0, math.huge, 0, 0, 0 end - elseif comparator ~= "atLeast" and comparator ~= "atMost" and comparator ~= "equal" - and comparator ~= "less" and comparator ~= "more" then - Ovale:Errorf("unknown compare term %s", comparator) + elseif not OvaleCondition.COMPARATOR[comparator] then + Ovale:Errorf("unknown comparator %s", comparator) elseif not limit then Ovale:Errorf("comparator %s missing limit", comparator) elseif rate == 0 then -- 1.7.9.5