From 042ef3e43cfac43e83fc3a5835aeede65237793b Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Tue, 13 Oct 2009 20:09:18 +0000 Subject: [PATCH] bug fix with TargetDeadIn() git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@121 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Condition.lua b/Condition.lua index 24cf62f..c3e12eb 100644 --- a/Condition.lua +++ b/Condition.lua @@ -223,13 +223,14 @@ local function getTargetDead() savedHealth = {} end local newHealth = UnitHealth("target") - if second~=lastSaved then + if second~=lastSaved and targetGUID then lastSaved = second local mod10 = second % 10 local prevHealth = savedHealth[mod10] savedHealth[mod10] = newHealth - if prevHealth then - lastSPD = 10/(newHealth-prevHealth) + if prevHealth>newHealth then + lastSPD = 10/(prevHealth-newHealth) +-- print("dps = " .. (1/lastSPD)) end end -- Rough estimation -- 1.7.9.5