From 7be4ac1fedf9f6e00a356e6717019febf3e9982d Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 6 May 2014 14:22:01 +0000 Subject: [PATCH] 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 --- conditions/TickTime.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 1.7.9.5