mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
libpredict: calculate timeleft in GetHotDuration
This commit is contained in:
+12
-9
@@ -541,16 +541,19 @@ libpredict.sender:SetScript("OnEvent", function()
|
||||
end
|
||||
end)
|
||||
|
||||
function libpredict:getHoTTime(unit, spell)
|
||||
if unit == UNKNOWNOBJECT or unit == UNKOWNBEING then
|
||||
return
|
||||
end
|
||||
local dbUnit = hots[UnitName(unit)]
|
||||
if dbUnit and dbUnit[spell] and (dbUnit[spell].start + dbUnit[spell].duration) > GetTime() then
|
||||
return dbUnit[spell].start, dbUnit[spell].duration
|
||||
else
|
||||
return
|
||||
function libpredict:GetHotDuration(unit, spell)
|
||||
if unit == UNKNOWNOBJECT or unit == UNKOWNBEING then return end
|
||||
|
||||
local start, duration, timeleft
|
||||
|
||||
local unitdata = hots[UnitName(unit)]
|
||||
if unitdata and unitdata[spell] and (unitdata[spell].start + unitdata[spell].duration) > GetTime() - 1 then
|
||||
start = unitdata[spell].start
|
||||
duration = unitdata[spell].duration
|
||||
timeleft = (start + duration) - GetTime()
|
||||
end
|
||||
|
||||
return start, duration, timeleft
|
||||
end
|
||||
|
||||
pfUI.api.libpredict = libpredict
|
||||
|
||||
Reference in New Issue
Block a user