# HG changeset patch # User Vynn # Date 1486395669 18000 # Node ID 6ee128c4bd4db48b9a4f1f3aeb861a9e48e4ded1 # Parent f653da97b5bd432f7cc197d5e9a75a8786e91d00 One more bug fix with initializing the addon. diff -r f653da97b5bd -r 6ee128c4bd4d Spotlight.lua --- a/Spotlight.lua Mon Feb 06 10:40:29 2017 -0500 +++ b/Spotlight.lua Mon Feb 06 10:41:09 2017 -0500 @@ -1,3 +1,5 @@ +local initizlized = false; + local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Spotlight", { type = "data source", text = "Nothing to track!", @@ -23,7 +25,7 @@ SlashHandler(msg); end -local function Initialize () +local function Initialize() if not Spotlight.Status then Spotlight.Status = { Dungeons = { @@ -136,10 +138,11 @@ local function EventHandler(self, event, ...) if event == "VARIABLES_LOADED" then if Initialize() then - print("|T" .. GetInventoryItemTexture("player", 16) .. ":0|t |cffe5cc80Spotlight v" .. GetAddOnMetadata("Spotlight", "Version") .. " Loaded!|r") + initialized = true; + print("|T" .. (Spotlight.Icon or 1355359) .. ":0|t |cffe5cc80Spotlight v" .. GetAddOnMetadata("Spotlight", "Version") .. " Loaded!|r"); end end - if event == "CRITERIA_UPDATE" or "PLAYER_ENTERING_WORLD" then + if event == "CRITERIA_UPDATE" or "PLAYER_ENTERING_WORLD" and initialized then Spotlight.Update(); end end