Fix events registration and handling
This commit is contained in:
parent
5e9ad689a8
commit
28161e3070
6
core.lua
6
core.lua
|
@ -92,16 +92,18 @@ child['specs'] = {
|
|||
}
|
||||
}
|
||||
}
|
||||
local function OnEvent(self, event, ...)
|
||||
local function OnEvent(lib, self, event, ...)
|
||||
if(type(events[event])=='function') then
|
||||
events[event](self,event,...)
|
||||
else
|
||||
print("[itemsdb] Failed", ...)
|
||||
end
|
||||
end
|
||||
function child.events:PLAYER_ENTERING_WORLD(event)
|
||||
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
local list = {}
|
||||
for event,func in pairs(events) do
|
||||
if((child:IsClassic() and not db['donthookCraftFrame']) or (not child:IsClassic() and not skipRetail[event])) then
|
||||
if(child:IsClassic() or (not child:IsClassic() and not skipRetail[event])) then
|
||||
list[#list+1] = event
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue