Quantcast

Fix bug that caused state auras to always be at least 1 stack.

Johnny C. Lam [05-03-14 - 23:17]
Fix bug that caused state auras to always be at least 1 stack.

This bug was hidden before the change to garbage-collect only the state
auras that were reflected in the real auras.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1367 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index ac77f69..74075d8 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -917,10 +917,10 @@ statePrototype.ApplySpellAuras = function(state, spellId, guid, startCast, endCa
 			local duration, dotDuration, tick, numTicks = state:GetDuration(auraId, spellcast)
 			local stacks = 1

-			if type(spellData) == "number" and spellData > 0 then
+			if type(spellData) == "number" then
 				stacks = spellData
 				-- Deprecated after transition.
-				if not (si and si.duration) then
+				if not (si and si.duration) and spellData > 0 then
 					-- Aura doesn't have duration SpellInfo(), so treat spell data as duration.
 					duration = spellData
 					stacks = 1
@@ -1004,7 +1004,7 @@ statePrototype.ApplySpellAuras = function(state, spellId, guid, startCast, endCa
 				end
 			else
 				-- Aura is not on the target.
-				if stacks > 0 then
+				if spellData ~= "refresh" and stacks > 0 then
 					-- Spellcast causes a new aura.
 					Ovale:Logf("New aura %d at %f on %s", auraId, atTime, guid)
 					-- Add an aura in the simulator and copy the existing aura information over.