From a9247e1f76d7ad7557437be4392b08013319fb2b Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Sun, 31 Jul 2022 21:48:09 +0200 Subject: [PATCH] fix trinket racial tracking --- Modules/Racial.lua | 2 -- Modules/Trinket.lua | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Modules/Racial.lua b/Modules/Racial.lua index 18837e7..65f0cd0 100644 --- a/Modules/Racial.lua +++ b/Modules/Racial.lua @@ -223,11 +223,9 @@ function Racial:TRINKET_USED(unit) -- Wrath only if racial.active and racial.timeLeft >= 45 then -- do nothing else - racial.active = false self:Used(unit, GetTime(), 45) end elseif button.race == "Human" then - racial.active = false self:Used(unit, GetTime(), 120) end end diff --git a/Modules/Trinket.lua b/Modules/Trinket.lua index b8ffa61..b575057 100644 --- a/Modules/Trinket.lua +++ b/Modules/Trinket.lua @@ -33,6 +33,7 @@ function Trinket:Initialize() self.frames = {} if Gladdy.db.trinketEnabled then self:RegisterMessage("JOINED_ARENA") + self:RegisterMessage("TRINKET_USED") if Gladdy.expansion == "Wrath" then self:RegisterMessage("RACIAL_USED") end @@ -289,11 +290,9 @@ function Trinket:RACIAL_USED(unit) -- Wrath only if trinket.active and trinket.timeLeft >= 45 then -- do nothing else - trinket.active = false self:Used(unit, GetTime() * 1000, 45000) end elseif Gladdy.buttons[unit].race == "Human" then - trinket.active = false self:Used(unit, GetTime() * 1000, 120000) end end @@ -319,14 +318,14 @@ function Trinket:Used(unit, startTime, duration) if (not trinket or not Gladdy.db.trinketEnabled) then return end - if not trinket.active then + --if not trinket.active then trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime() if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end trinket.active = true if Gladdy.db.trinketColored then trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd)) end - end + --end end function Trinket:GetOptions()