Quantcast

fixed saved variable access for hooked function. saved vars were nil for a new users

Alex Shubert [10-23-12 - 10:19]
fixed saved variable access for hooked function. saved vars were nil for a new users
Filename
AutoTurnIn.lua
QuestLevel.lua
diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua
index 6a7ff7a..27038ff 100644
--- a/AutoTurnIn.lua
+++ b/AutoTurnIn.lua
@@ -87,6 +87,9 @@ function AutoTurnIn:OnEnable()

 	self:SetEnabled(DB.enabled)
 	self:RegisterGossipEvents()
+	hooksecurefunc("QuestLog_Update", AutoTurnIn.ShowQuestLevelInLog)
+	hooksecurefunc(QuestLogScrollFrame, "update", AutoTurnIn.ShowQuestLevelInLog)
+	hooksecurefunc("WatchFrame_Update", AutoTurnIn.ShowQuestLevelInWatchFrame)
 end

 function AutoTurnIn:OnDisable()
diff --git a/QuestLevel.lua b/QuestLevel.lua
index 9a8395e..32b67e3 100644
--- a/QuestLevel.lua
+++ b/QuestLevel.lua
@@ -39,9 +39,6 @@ function AutoTurnIn:ShowQuestLevelInLog()
 		end
 	end
 end
--- Quest level in a log.
-hooksecurefunc("QuestLog_Update", AutoTurnIn.ShowQuestLevelInLog)
-hooksecurefunc(QuestLogScrollFrame, "update", AutoTurnIn.ShowQuestLevelInLog)

 function AutoTurnIn:ShowQuestLevelInWatchFrame()
 	if not AutoTurnInCharacterDB.watchlevel then
@@ -69,4 +66,3 @@ function AutoTurnIn:ShowQuestLevelInWatchFrame()
 		end
 	end
 end
-hooksecurefunc("WatchFrame_Update", AutoTurnIn.ShowQuestLevelInWatchFrame)
\ No newline at end of file