Skip to content

Commit

Permalink
Fix bad comparison and potential late loading of LibSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Aug 4, 2024
1 parent c530692 commit 9203852
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Transcriptor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1648,19 +1648,6 @@ do
end)
end

--------------------------------------------------------------------------------
-- LibSpec
--

do
local LibSpec = LibStub and LibStub("LibSpecialization", true)
if LibSpec then
LibSpec:Register(Transcriptor, function(specId, role, position, playerName, talents)
playerSpecList[playerName] = {specId, role, position, talents}
end)
end
end

--------------------------------------------------------------------------------
-- Addon
--
Expand Down Expand Up @@ -1741,6 +1728,13 @@ init:SetScript("OnEvent", function(self, event)
SLASH_TRANSCRIPTOR2 = "/transcript"
SLASH_TRANSCRIPTOR3 = "/ts"

local LibSpec = LibStub and LibStub("LibSpecialization", true)
if LibSpec then
LibSpec:Register(Transcriptor, function(specId, role, position, playerName, talents)
playerSpecList[playerName] = {specId, role, position, talents}
end)
end

self:UnregisterEvent(event)
self:RegisterEvent("PLAYER_LOGOUT")
self:SetScript("OnEvent", function()
Expand Down Expand Up @@ -1831,7 +1825,7 @@ do
hiddenUnitAuraCollector = {}
playerSpellCollector = {}
previousSpecialEvent = nil
if not compareStartTime or debugprofilestop()-compareStartTime > 5 then
if not logStartTime or (debugprofilestop()/1000)-logStartTime > 3 then
compareStartTime = debugprofilestop()
logStartTime = compareStartTime / 1000
prevEncounterStart = nil
Expand Down

0 comments on commit 9203852

Please sign in to comment.