Quantcast

If the WorldMap is open, use the map's MapID, else guess the current players' map for a QuestPOI.

Ludovicus [07-26-18 - 22:27]
If the WorldMap is open, use the map's MapID, else guess the current players' map for a QuestPOI.
Filename
TomTom_POIIntegration.lua
diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua
index 9ea4147..db35d92 100755
--- a/TomTom_POIIntegration.lua
+++ b/TomTom_POIIntegration.lua
@@ -172,7 +172,7 @@ local function poi_OnClick(self, button)
     SetCVar("questPOI", 1)

     -- Run our logic, and set a waypoint for this button
-    local m = C_Map.GetBestMapForUnit("player")
+    local m

     QuestPOIUpdateIcons()

@@ -182,6 +182,12 @@ local function poi_OnClick(self, button)
     if questIndex and questIndex ~= 0 then
         title = GetQuestLogTitle(questIndex)
         completed, x, y = QuestPOIGetIconInfo(self.questID)
+        -- If the WorldMap is open, use the map's MapID, else guess the current players' map
+        if WorldMapFrame:IsShown() then
+            m = WorldMapFrame:GetMapID()
+        else
+            m = C_Map.GetBestMapForUnit("player")
+        end
     else
         -- Must be a World Quest
         title = C_TaskQuest.GetQuestInfoByQuestID(self.questID)