From f4ee8657bd4778cd6091009d2d24ece56c72e1b7 Mon Sep 17 00:00:00 2001 From: Jim Whitehead Date: Mon, 20 Oct 2014 21:47:02 +0200 Subject: [PATCH] Fix an issue with automatic quest POIs The GetQuestLogTitle() had two returns removed and another added, so the questID return has been moved. --- TomTom_POIIntegration.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua index 3d3b92b..796f0ca 100755 --- a/TomTom_POIIntegration.lua +++ b/TomTom_POIIntegration.lua @@ -16,6 +16,10 @@ local astrolabe = DongleStub("Astrolabe-1.0") local lastWaypoint local scanning -- This function is not re-entrant, stop that +local function getQIDFromIndex(questIndex) + return (select(8, GetQuestLogTitle(questIndex))) +end + local function ObjectivesChanged() -- This function should only run if enableClosest is set if not enableClosest then @@ -62,7 +66,7 @@ local function ObjectivesChanged() break end - local qid = select(9, GetQuestLogTitle(questIndex)) + local qid = getQIDFromIndex(questIndex) local completed, x, y, objective = QuestPOIGetIconInfo(qid) if x and y then @@ -78,7 +82,7 @@ local function ObjectivesChanged() if closest then local questIndex = GetQuestIndexForWatch(closest) local title = GetQuestLogTitle(questIndex) - local qid = select(9, GetQuestLogTitle(questIndex)) + local qid = getQIDFromIndex(questIndex) local completed, x, y, objective = QuestPOIGetIconInfo(qid) if completed then @@ -161,7 +165,7 @@ local function poi_OnClick(self, button) if not questIndex and self.questId then -- Lookup the questIndex for the given questId for idx = 1, GetNumQuestLogEntries(), 1 do - local qid = select(9, GetQuestLogTitle(idx)) + local qid = getQIDFromIndex(idx) if qid == self.questId then questIndex = idx end @@ -173,7 +177,7 @@ local function poi_OnClick(self, button) end local title = GetQuestLogTitle(questIndex) - local qid = select(9, GetQuestLogTitle(questIndex)) + local qid = getQIDFromIndex(questIndex) local completed, x, y, objective = QuestPOIGetIconInfo(qid) if completed then title = "Turn in: " .. title -- 1.7.9.5