View Single Post
11-12-08, 11:51 AM   #22
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by p3lim View Post
The following worked perfectly for me

Code:
function pMinimap:ADDON_LOADED(event)
    pMinimapDB = pMinimapDB or {}
    for k,v in pairs(defaults) do
        if(type(pMinimapDB[k]) == 'nil') then
            pMinimapDB[k] = v
        end
    end

    self:UnregisterEvent(event)

    -- rest of the addon here

end
yup that would work.

Just a quick note though pMinimap:ADDON_LOADED will be called multiple times even though you've unregistered the event, check the addonarg matches your own addonname before doing anything.
  Reply With Quote