Quantcast

Back out parts of r625 and r627 to remove aura filtering changes.

Johnny C. Lam [03-11-13 - 03:51]
Back out parts of r625 and r627 to remove aura filtering changes.

We now track all auras on all units, just like all raid frame addons do,
instead of filtering away ones that aren't referenced in the current
script.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@743 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
OvaleCompile.lua
OvaleCondition.lua
OvaleData.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index efd1e45..1b84091 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -46,19 +46,17 @@ function OvaleAura:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 	if strfind(event, "SPELL_AURA_") == 1 then
 		local spellId, spellName, spellSchool, auraType = select(12, ...)

-		if (sourceGUID == self.playerGUID and OvaleData.spellFilter.mine[spellId]) or OvaleData.spellFilter.any[spellId] then
-			local unitId = OvaleGUID:GetUnitId(destGUID)
+		local unitId = OvaleGUID:GetUnitId(destGUID)

-			-- Only update for "*target" unit IDs.  All others are handled by UNIT_AURA event handler.
-			if unitId and unitId ~= "target" and strfind(unitId, "target") then
-				self:UpdateAuras(unitId, destGUID)
-			end
+		-- Only update for "*target" unit IDs.  All others are handled by UNIT_AURA event handler.
+		if unitId and unitId ~= "target" and strfind(unitId, "target") then
+			self:UpdateAuras(unitId, destGUID)
+		end

-			if sourceGUID == self.playerGUID and (event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESH" or event == "SPELL_AURA_APPLIED_DOSE") then
-				local aura = self:GetAuraByGUID(destGUID, spellId, true)
-				if aura then
-					aura.spellHasteMultiplier = OvalePaperDoll:GetSpellHasteMultiplier()
-				end
+		if sourceGUID == self.playerGUID and (event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESH" or event == "SPELL_AURA_APPLIED_DOSE") then
+			local aura = self:GetAuraByGUID(destGUID, spellId, true)
+			if aura then
+				aura.spellHasteMultiplier = OvalePaperDoll:GetSpellHasteMultiplier()
 			end
 		end
 	end
@@ -170,13 +168,11 @@ function OvaleAura:UpdateAuras(unitId, unitGUID)
 				break
 			end
 		else
-			if (unitCaster == "player" and OvaleData.spellFilter.mine[spellId]) or OvaleData.spellFilter.any[spellId] then
-				self:AddAura(unitGUID, spellId, unitCaster, icon, count, debuffType, duration, expirationTime, isStealable, name, value1)
-				if debuffType then
-					-- TODO: not very clean
-					-- should be computed by OvaleState:GetAura
-					self:AddAura(unitGUID, debuffType, unitCaster, icon, count, debuffType, duration, expirationTime, isStealable, name, value1)
-				end
+			self:AddAura(unitGUID, spellId, unitCaster, icon, count, debuffType, duration, expirationTime, isStealable, name, value1)
+			if debuffType then
+				-- TODO: not very clean
+				-- should be computed by OvaleState:GetAura
+				self:AddAura(unitGUID, debuffType, unitCaster, icon, count, debuffType, duration, expirationTime, isStealable, name, value1)
 			end

 			if unitId == "player" then
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 10197a1..acdfd4e 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -201,18 +201,6 @@ local function ParseFunction(prefix, func, params)
 				end
 			end
 		end
-
-		-- For the conditions that refer to aura spell IDs, add those spell IDs to
-		-- the list of auras OvaleAura should be tracking.
-		if OvaleCondition.auraConditions[func] then
-			if type(spellId) == "number" then
-				OvaleData:AddSpellToFilter(spellId, mine)
-			elseif OvaleData.buffSpellList[spellId] then
-				for _, v in pairs(OvaleData.buffSpellList[spellId]) do
-					OvaleData:AddSpellToFilter(v, mine)
-				end
-			end
-		end
 	end

 	return newNodeName
@@ -618,8 +606,6 @@ local function CompileScript(text)
 	text = CompileDeclarations(text)
 	text = CompileInputs(text)

-	OvaleData:ResetSpellFilter()
-
 	for p,t in strgmatch(text, "AddFunction%s+(%w+)%s*(%b{})") do
 		local newNode = ParseCommands(t)
 		if newNode then
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 40e8601..8935c9e 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -422,8 +422,6 @@ end
 --<public-static-properties>
 -- Script conditions.
 OvaleCondition.conditions = {}
--- List of script conditions that take an aura spell ID as a parameter.
-OvaleCondition.auraConditions = {}
 -- List of script conditions that refer to a castable spell from the player's spellbook.
 OvaleCondition.spellbookConditions = { spell = true }

@@ -491,8 +489,6 @@ OvaleCondition.conditions.buffcount = function(condition)
 	return start, ending, count, 0, 0
 end
 OvaleCondition.conditions.debuffcount = OvaleCondition.conditions.buffcount
-OvaleCondition.auraConditions.buffcount = true
-OvaleCondition.auraConditions.debuffcount = true

 --- Get the total duration of the aura from when it was first applied to when it ended.
 -- @name BuffDuration
@@ -512,8 +508,6 @@ OvaleCondition.conditions.buffduration = function(condition)
 	return compare(diffTime(start, ending), condition[2], condition[3])
 end
 OvaleCondition.conditions.debuffduration = OvaleCondition.conditions.buffduration
-OvaleCondition.auraConditions.buffduration = true
-OvaleCondition.auraConditions.debuffduration = true

 --- Test if an aura is expired, or will expire after a given number of seconds.
 -- @name BuffExpires
@@ -548,8 +542,6 @@ OvaleCondition.conditions.buffexpires = function(condition)
 	return addTime(ending, -timeBefore)
 end
 OvaleCondition.conditions.debuffexpires = OvaleCondition.conditions.buffexpires
-OvaleCondition.auraConditions.buffexpires = true
-OvaleCondition.auraConditions.debuffexpires = true

 --- Get the remaining time in seconds on an aura.
 -- @name BuffRemains
@@ -576,8 +568,6 @@ OvaleCondition.conditions.buffremains = function(condition)
 	end
 end
 OvaleCondition.conditions.debuffremains = OvaleCondition.conditions.buffremains
-OvaleCondition.auraConditions.buffremains = true
-OvaleCondition.auraConditions.debuffremains = true

 	-- Returns the time elapsed since the last buff gain
 	-- TODO won't work because the aura is not kept in cache
@@ -601,8 +591,6 @@ OvaleCondition.conditions.buffgain = function(condition)
 	return 0, nil, 0, timeGain, 1
 end
 OvaleCondition.conditions.debuffgain = OvaleCondition.conditions.buffgain
-OvaleCondition.auraConditions.buffgain = true
-OvaleCondition.auraConditions.debuffgain = true

 --- Test if an aura is present or if the remaining time on the aura is more than the given number of seconds.
 -- @name BuffPresent
@@ -633,8 +621,6 @@ OvaleCondition.conditions.buffpresent = function(condition)
 	return start, addTime(ending, -timeBefore)
 end
 OvaleCondition.conditions.debuffpresent = OvaleCondition.conditions.buffpresent
-OvaleCondition.auraConditions.buffpresent = true
-OvaleCondition.auraConditions.debuffpresent = true

 --- Get the number of stacks of an aura on the target.
 -- @name BuffStacks
@@ -659,8 +645,6 @@ OvaleCondition.conditions.buffstacks = function(condition)
 	return start, ending, stacks, 0, 0
 end
 OvaleCondition.conditions.debuffstacks = OvaleCondition.conditions.buffstacks
-OvaleCondition.auraConditions.buffstacks = true
-OvaleCondition.auraConditions.debuffstacks = true

 --- Test if there is a stealable buff on the target.
 -- @name BuffStealable
@@ -676,7 +660,6 @@ OvaleCondition.auraConditions.debuffstacks = true
 OvaleCondition.conditions.buffstealable = function(condition)
 	return OvaleAura:GetStealable(getTarget(condition.target))
 end
-OvaleCondition.auraConditions.buffstealable = true

 --- Get the current number of Burning Embers for destruction warlocks.
 -- @name BurningEmbers
@@ -2499,7 +2482,6 @@ OvaleCondition.conditions.tickvalue = function(condition)
 	end
 	return compare(value, condition[2], condition[3])
 end
-OvaleCondition.auraConditions.tickvalue = true

 --- Get the estimated total number of ticks of a damage-over-time (DoT) aura.
 -- @name Ticks
@@ -2521,7 +2503,6 @@ OvaleCondition.conditions.ticks = function(condition)
 	end
 	return nil
 end
-OvaleCondition.auraConditions.ticks = true

 --- Get the number of ticks that would be added if the dot is refreshed.
 -- Not implemented, always returns 0.
@@ -2533,7 +2514,6 @@ OvaleCondition.auraConditions.ticks = true
 OvaleCondition.conditions.ticksadded = function(condition)
 	return 0, nil, 0, 0, 0
 end
-OvaleCondition.auraConditions.ticksadded = true

 --- Get the remaining number of ticks of a damage-over-time (DoT) aura on a target.
 -- @name TicksRemain
@@ -2562,7 +2542,6 @@ OvaleCondition.conditions.ticksremain = function(condition)
 	end
 	return nil
 end
-OvaleCondition.auraConditions.ticksremain = true

 --- Get the number of seconds between ticks of a damage-over-time (DoT) aura on a target.
 -- @name TickTime
@@ -2588,7 +2567,6 @@ OvaleCondition.conditions.ticktime = function(condition)
 	end
 	return nil
 end
-OvaleCondition.auraConditions.ticktime = true

 --- Get the number of seconds elapsed since the player entered combat.
 -- @name TimeInCombat
diff --git a/OvaleData.lua b/OvaleData.lua
index c79530c..51e2d03 100644
--- a/OvaleData.lua
+++ b/OvaleData.lua
@@ -52,8 +52,6 @@ OvaleData.glyphs = {}
 OvaleData.spellInfo = {}
 --spells that count for scoring
 OvaleData.scoreSpell = {}
---spells that should be tracked
-OvaleData.spellFilter = { any = {}, mine = {} }

 OvaleData.power =
 {
@@ -504,21 +502,6 @@ function OvaleData:ResetSpellInfo()
 	self.spellInfo = {}
 end

-function OvaleData:ResetSpellFilter()
-	self.spellFilter.any = {}
-	self.spellFilter.mine = {}
-end
-
-function OvaleData:AddSpellToFilter(spellId, mine)
-	if mine then
-		if not self.spellFilter.mine[spellId] then
-			self.spellFilter.mine[spellId] = GetSpellInfo(spellId)
-		end
-	elseif not self.spellFilter.any[spellId] then
-		self.spellFilter.any[spellId] = GetSpellInfo(spellId)
-	end
-end
-
 function OvaleData:GetGCD(spellId)
 	if spellId and self.spellInfo[spellId] then
 		if self.spellInfo[spellId].haste == "spell" then