View Single Post
04/24/14, 09:28 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Originally Posted by Sharlikran View Post
Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("HarvestMap", EVENT_ADD_ON_LOADED, Harvest.OnLoad)
That is at the bottom of the main file.
Lua Code:
  1. function Harvest.OnLoad(eventCode, addOnName)
  2.  
  3.     {{{{ Bunch of stuff here}}}}
  4.  
  5.     Harvest.nodes = ZO_SavedVars:NewAccountWide("Harvest_SavedVars", 2, "nodes", { data = {} } )
  6.     if Harvest.settings.account then
  7.         Harvest.settings = ZO_SavedVars:NewAccountWide("Harvest_SavedVars", 1, "settings",
  8.         {{{{ stuf }}}}
  9.         }  
  10.     else
  11.         Harvest.settings = ZO_SavedVars:New("Harvest_SavedVars", 1, "settings",
  12.         {{{{ stuf }}}}
  13.         }  
  14.     end
That will error ^^
Well, of course it will. You're not checking the addonName return to see if it was actually your addon that loaded and is ready.
  Reply With Quote