From 85fdffad70c41332fcb2c5eaf23b8ad62fda097a Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 27 May 2014 18:27:30 +0000 Subject: [PATCH] Fix Casting() which returned the wrong value for boolean condition. In Ovale, proper boolean conditions return time spans that either contain (true) or do not contain (false) the current time. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1498 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- conditions/Casting.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/conditions/Casting.lua b/conditions/Casting.lua index 174092c..ffa7f88 100644 --- a/conditions/Casting.lua +++ b/conditions/Casting.lua @@ -64,26 +64,24 @@ do end end - local isCasting = false if castSpellId or castSpellName then if not spellId then -- No spell specified, so whatever spell is currently casting. - isCasting = true + return start, ending elseif OvaleData.buffSpellList[spellId] then for id in pairs(OvaleData.buffSpellList[spellId]) do if id == castSpellId or OvaleSpellBook:GetSpellName(id) == castSpellName then - isCasting = true - break + return start, ending end end elseif spellId == "harmful" and API_IsHarmfulSpell(castSpellName) then - isCasting = true + return start, ending elseif spellId == "helpful" and API_IsHelpfulSpell(castSpellName) then - isCasting = true + return start, ending end end - return isCasting + return nil end - OvaleCondition:RegisterCondition("casting", false, casting) + OvaleCondition:RegisterCondition("casting", false, Casting) end -- 1.7.9.5