View Single Post
05-08-14, 01:16 AM   #4
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by Nimhfree View Post
Bear in mind that it is late and I am really tired.

It appears that the signature for your OnEvent function should be (self, event, ...) instead of (event). What you are probably doing is comparing "ADDON_LOADED" to self instead of event.

Alos, in processing ADDON_LOADED you also want to check ... because the first parameter passed there will be the name of an addon. If it is not your addon name you should ignore it and not do any work. Basically your addon will be able to see other addons get loaded and it will be sent ADDON_LOADED for each. You are not guaranteed a specific order of those addon loads either.

So, you might want to change your code to:

function lf:OnEvent(self, event, ...)
if "ADDON_LOADED" == event then
if "LCI" == ... then
CheckNewChar()
end
end
end
Originally Posted by WhiteWolf87 View Post
Thank you for responding. Gave it a try and nothing loaded when i tested it
Not to good at lua but I do know that it needs to be
Code:
if event == "ADDON_LOADED"
not the other way around.
  Reply With Quote