From 7355cd90b6ee4b63a3c503795513def36782b133 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 5 Sep 2016 09:53:00 +0200 Subject: [PATCH] refactoring --- aux-addon.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index bc3b4a7..0b90613 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -42,14 +42,14 @@ ADDON_LOADED = t do local handlers, handlers2 = t, t function public.LOAD.set(f) tinsert(handlers, f) end - function public.LOAD2.set(f) handlers2[f] = true end + function public.LOAD2.set(f) tinsert(handlers2, f) end event_frame:SetScript('OnEvent', function() if event == 'ADDON_LOADED' then (ADDON_LOADED[arg1] or nop)() elseif event == 'VARIABLES_LOADED' then for _, f in handlers do f() end elseif event == 'PLAYER_LOGIN' then - for f in handlers2 do f() end + for _, f in handlers2 do f() end print('v' .. version .. ' loaded.') else M[event]()