Fix usage of self instead of the right frame in callbacks.
This commit is contained in:
parent
10352297aa
commit
11219e3ffe
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("LibCombatLog", 17)
|
||||
local lib = LibStub:NewLibrary("LibCombatLog", 18)
|
||||
if not lib then return end
|
||||
local CombatLogGetCurrentEventInfo, pairs, unpack, type = CombatLogGetCurrentEventInfo, pairs, unpack, type
|
||||
lib.mixinTargets = lib.mixinTargets or {}
|
||||
|
@ -37,24 +37,24 @@ local function splitEvent(event)
|
|||
end
|
||||
return {'NONE','NONE'}
|
||||
end
|
||||
local function OnEvent2(self,event)
|
||||
local function OnEvent2(self, event)
|
||||
if(event == 'COMBAT_LOG_EVENT_UNFILTERED') then
|
||||
local data = { event, CombatLogGetCurrentEventInfo()}
|
||||
local prefix, suffix = unpack(splitEvent(data[3]))
|
||||
if(lib['regs'][data[3]]) then
|
||||
for k, v in pairs(lib['regs'][data[3]]) do
|
||||
k[v](self, data, prefix, suffix)
|
||||
k[v](k, data, prefix, suffix)
|
||||
end
|
||||
end
|
||||
if(suffix) then
|
||||
lib['regs'][suffix] = lib['regs'][suffix] or {}
|
||||
for k, v in pairs(lib['regs'][suffix]) do
|
||||
k[v](self, data, prefix, suffix)
|
||||
k[v](k, data, prefix, suffix)
|
||||
end
|
||||
end
|
||||
elseif(event == 'PLAYER_REGEN_DISABLED' or event == 'PLAYER_REGEN_ENABLED') then
|
||||
for k, v in pairs(lib['regs']['PLAYER_REGEN']) do
|
||||
k[v](self, event)
|
||||
k[v](k, event)
|
||||
end
|
||||
else
|
||||
print('unknown',event)
|
||||
|
|
Loading…
Reference in New Issue