Quantcast

fixed table issue

Alex Shubert [02-23-12 - 20:16]
fixed table issue
Filename
AutoTurnIn.lua
localization_DE.lua
localization_EN.lua
localization_RU.lua
diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua
index 6f8951d..0e2645b 100644
--- a/AutoTurnIn.lua
+++ b/AutoTurnIn.lua
@@ -87,14 +87,16 @@ local function GetItemAmount(isCurrency, item)
 	return amount and amount or 0
 end

--- (gaq[i+3]) equals "1" if quest is complete, "nil" otherwise
-function AutoTurnIn:GOSSIP_SHOW()

-	if (GetGossipActiveQuests()) then
-		local gaq = {GetGossipActiveQuests()}
-		for i=1, #gaq, 4 do
-			if (gaq[i+3]) then  -- complete status
-				local quest = L.quests[gaq[i]]
+-- (gaq[i+3]) equals "1" if quest is complete, "nil" otherwise
+-- why not 	gaq={GetGossipAvailableQuests()}? Well, tables in lua are truncated for values with ending `nil`. So: '#' for {1,nil, "b", nil} returns 1
+function AutoTurnIn:GOSSIP_SHOW()
+	local function VarArgForActiveQuests(...)
+		for i=1, select("#", ...), 4 do
+			local completeStatus = select(i+3, ...)
+			if (completeStatus) then  -- complete status
+				local questname = select(i, ...)
+				local quest = L.quests[questname]
 				if AutoTurnInCharacterDB.all or quest  then
 					if quest and quest.amount then
 						if GetItemAmount(quest.currency, quest.item) > quest.amount then
@@ -109,11 +111,11 @@ function AutoTurnIn:GOSSIP_SHOW()
 			end
 		end
 	end
-
-	if (GetGossipAvailableQuests()) then
-		gaq={GetGossipAvailableQuests()}
-		for i=1, #gaq, 5 do
-			local quest = L.quests[gaq[i]]
+
+	local function VarArgForAvailableQuests(...)
+		for i=1, select("#", ...), 5 do
+			local questname = select(i, ...)
+			local quest = L.quests[questname]
 			if AutoTurnInCharacterDB.all or (quest and (not quest.donotaccept)) then
 				if quest and quest.amount then
 					if GetItemAmount(quest.currency, quest.item) > quest.amount then
@@ -127,6 +129,8 @@ function AutoTurnIn:GOSSIP_SHOW()
 			end
 		end
 	end
+	VarArgForActiveQuests(GetGossipActiveQuests())
+	VarArgForAvailableQuests(GetGossipAvailableQuests())
 end

 function AutoTurnIn:QUEST_DETAIL()
diff --git a/localization_DE.lua b/localization_DE.lua
index 1a623aa..0d4163e 100644
--- a/localization_DE.lua
+++ b/localization_DE.lua
@@ -209,10 +209,12 @@ privateTable.L.quests = {
 --Sons of Hodir
 ['Arngrim füttern']="",
 ['Den Helm polieren']="",
+['Jagd auf Spione']="",
 ['Heiß und kalt']="",
+['Hodirs Tribut']={item="Relikt von Ulduar", amount=10, currency=false},
 ['Hodirs Horn blasen']="",
 ['Hodirs Speer werfen']="",
-['Jagd auf Spione']="",
+['Vergesst das Immerfrosteis nicht!']={item="Immerfrostsplitter", amount=1, currency=false},
 --The Wyrmrest Accord
 ['Drachenjagd']="",
 ['Mysterium der Unendlichkeit']="",
diff --git a/localization_EN.lua b/localization_EN.lua
index 579d78c..d46c358 100644
--- a/localization_EN.lua
+++ b/localization_EN.lua
@@ -204,8 +204,10 @@ privateTable.L.quests = {
 --Sons of Hodir
 ["Blowing Hodir's Horn"]="",
 ["Feeding Arngrim"]="",
+["Hodir's Tribute"]={item="Relic of Ulduar", amount=10, currency=false},
 ["Hot and Cold"]="",
 ["Polishing the Helm"]="",
+["Remember Everfrost!"]={item="Everfrost Chip", amount=1, currency=false},
 ["Spy Hunter"]="",
 ["Thrusting Hodir's Spear"]="",
 --The Wyrmrest Accord
diff --git a/localization_RU.lua b/localization_RU.lua
index 45d7444..8406796 100644
--- a/localization_RU.lua
+++ b/localization_RU.lua
@@ -215,11 +215,13 @@ privateTable.L.quests = {
 ["Тренировка на поле боя"]="",
 ["У вражеских врат"]="",
 --Sons of Hodir
+["Больше Вечного льда!"]={item="Частичка Вечного льда", amount=1, currency=false},
 ["Бросая копье Ходира"]="",
 ["Жар и холод"]="",
 ["Звуки рога Ходира"]="",
 ["Контрразведчик"]="",
 ["Муки Арнгрима"]="",
+["Подношение Ходиру"]={item="Реликвия Ульдуара", amount=10, currency=false},
 ["Полировка шлема"]="",
 --The Wyrmrest Accord
 ["Асы, ввысь!"]="",