Quantcast

Default to checking for active auras in simulator after the current cast.

Johnny C. Lam [05-05-14 - 18:03]
Default to checking for active auras in simulator after the current cast.

Treat an aura in the simulator as active by default if it exists at
the end of the current spellcast, or the current time if no spell is
currently being cast.  This allows auras that are applied by the spell
being cast to show as active.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1384 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index 7161734..74ad0c6 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -887,18 +887,26 @@ do
 	end
 end

-statePrototype.IsActiveAura = function(state, aura, now)
-	now = now or state.currentTime
+statePrototype.IsActiveAura = function(state, aura, atTime)
+	-- Default to checking if an aura is active at the end of the current spellcast
+	-- in the simulator, or at the current time if no spell is being cast.
+	if not atTime then
+		if state.endCast and state.endCast > state.currentTime then
+			atTime = state.endCast
+		else
+			atTime = state.currentTime
+		end
+	end
 	local boolean = false
 	if aura then
 		if aura.state then
-			if aura.serial == state.serial and aura.stacks > 0 and aura.gain <= now and now <= aura.ending then
+			if aura.serial == state.serial and aura.stacks > 0 and aura.gain <= atTime and atTime <= aura.ending then
 				boolean = true
-			elseif aura.consumed and IsWithinAuraLag(aura.ending, now) then
+			elseif aura.consumed and IsWithinAuraLag(aura.ending, atTime) then
 				boolean = true
 			end
 		else
-			boolean = OvaleAura:IsActiveAura(aura, now)
+			boolean = OvaleAura:IsActiveAura(aura, atTime)
 		end
 	end
 	return boolean