Quantcast

Make TickTime() return the tick length of a new DoT if one isn't present.

Johnny C. Lam [05-06-14 - 14:22]
Make TickTime() return the tick length of a new DoT if one isn't present.

This matches SimC semantics where if a DoT is present, then "tick_time" is
the actual tick length of the DoT, but if the DoT is not present, then it
is the tick length of a new DoT with a current stat snapshot.

This fixes mage scripts not suggesting mage bombs.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1390 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
conditions/TickTime.lua
diff --git a/conditions/TickTime.lua b/conditions/TickTime.lua
index 5bfd6be..1cae4f3 100644
--- a/conditions/TickTime.lua
+++ b/conditions/TickTime.lua
@@ -38,9 +38,15 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) and aura.tick then
-			local value = aura.tick
-			return Compare(value, comparator, limit)
+		local tickTime
+		if state:IsActiveAura(aura) then
+			tickTime = aura.tick
+		else
+			local _, _, tick = state:GetDuration(auraId)
+			tickTime = tick
+		end
+		if tickTime and tickTime > 0 then
+			return Compare(tickTime, comparator, limit)
 		end
 		return Compare(math.huge, comparator, limit)
 	end