Quantcast

merge commit

Alex Shubert [04-20-12 - 06:24]
merge commit
Filename
AutoTurnIn.lua
AutoTurnIn.toc
diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua
index 8148383..33e9ed3 100644
--- a/AutoTurnIn.lua
+++ b/AutoTurnIn.lua
@@ -1,10 +1,11 @@
 local addonName, ptable = ...
 local L = ptable.L
 local C = ptable.CONST
+local TOCVersion = GetAddOnMetadata(addonName, "Version")

 AutoTurnIn = LibStub("AceAddon-3.0"):NewAddon("AutoTurnIn", "AceEvent-3.0", "AceConsole-3.0")
 AutoTurnIn.defaults = {enabled = true, all = false, lootreward = 1, tournament = 2,
-					   darkmoonteleport=true, togglekey=2, darkmoonautostart=true, showrewardtext=true}
+					   darkmoonteleport=true, togglekey=2, darkmoonautostart=true, showrewardtext=true, version=TOCVersion}}
 AutoTurnIn.ldb, AutoTurnIn.allowed = nil, nil
 AutoTurnIn.caption = addonName ..' [%s]'
 AutoTurnIn.funcList = {[1] = function() return false end, [2]=IsAltKeyDown, [3]=IsControlKeyDown, [4]=IsShiftKeyDown}
@@ -36,11 +37,8 @@ function AutoTurnIn:SetEnabled(enabled)
 end
 -- quest autocomplete handlers and functions
 function AutoTurnIn:OnEnable()
-	local vers = GetAddOnMetadata(addonName, "Version")
-
-	if (not AutoTurnInDB) or (not AutoTurnInDB.version or (AutoTurnInDB.version < vers)) then
+	if (not AutoTurnInCharacterDB) or (not AutoTurnInCharacterDB.version or (AutoTurnInCharacterDB.version < TOCVersion)) then
 		AutoTurnInCharacterDB = nil
-		_G.AutoTurnInDB = {version = vers}
 		self:Print(L["reset"])
 	end

diff --git a/AutoTurnIn.toc b/AutoTurnIn.toc
index a0947e4..be7d449 100644
--- a/AutoTurnIn.toc
+++ b/AutoTurnIn.toc
@@ -7,7 +7,6 @@
 ## Notes-enUS: Auto accept and complete daily or any quests
 ## Notes-deDE: Auto akzeptieren und komplett täglich oder alle Quests (send your translation to luraddon@gmail.com pls)
 ## OptionalDeps: Ace3
-## SavedVariables: AutoTurnInDB
 ## SavedVariablesPerCharacter: AutoTurnInCharacterDB
 ## X-Date: 2012-01-16
 ## X-Category: Quest