Well, that's not quite relevant to what I was saying; I was talking about a frame that's created for the sole purpose of handling a single hardcoded event, typically just one time, such as delaying something for after saved variables are loaded or after spell information is available. Obviously if your frame is handling more than one event, or if you dynamically register and unregister events, you probably have to check the event, and you are doing that in the code you posted.
Originally Posted by ravagernl
Code:
function addon.PLAYER_LOGIN()
-- on login (saved variables loaded + spellbook ready, etc...)
self:KillEvent("PLAYER_LOGIN")
end
|
I hope this was the result of "I'm too lazy to go find my real code and copy/paste it so here's some badly written fake code instead" and not your actual code, or you should be getting an error since "self" is not defined in that scope since you used a period instead of a colon.
Also, why go with "KillEvent" instead of just sticking to convention and naming that "UnregisterEvent" ?