diff --git a/Event.lua b/Event.lua index 2ad9052..b5936e6 100644 --- a/Event.lua +++ b/Event.lua @@ -152,7 +152,7 @@ function AprRC.event.functions.remove(event, questId, ...) tinsert(currentStep["LeaveQuests"], questId) else local step = { LeaveQuests = { questId } } - step.Zone = C_Map.GetBestMapForUnit("player") + step.Zone = AprRC:getZone() AprRC:NewStep(step) end --remove quest from state list @@ -212,7 +212,7 @@ function AprRC.event.functions.spell(event, unitTarget, castGUID, spellID) if key then local step = {} step[key] = AprRC:FindClosestIncompleteQuest() - step.Zone = C_Map.GetBestMapForUnit("player") + step.Zone = AprRC:getZone() AprRC:NewStep(step) end end diff --git a/helper/RouteManagement.lua b/helper/RouteManagement.lua index b32dba4..cee3bce 100644 --- a/helper/RouteManagement.lua +++ b/helper/RouteManagement.lua @@ -47,7 +47,7 @@ function AprRC:SetStepCoord(step, range) local y, x, z, mapID = UnitPosition("player") if x and y and not step.NoArrow then step.Coord = { x = x, y = y } - step.Zone = C_Map.GetBestMapForUnit("player") + step.Zone = AprRC:getZone() step.Range = range end end @@ -175,3 +175,13 @@ end function AprRC:IsTaxiInLookup(nodeID) return AprRCData.TaxiLookup[nodeID] or false end + +function AprRC:getZone() + local playerMapId + local currentMapId = C_Map.GetBestMapForUnit('player') + if currentMapId and Enum and Enum.UIMapType then + playerMapId = MapUtil.GetMapParentInfo(currentMapId, Enum.UIMapType.Zone, true) + playerMapId = playerMapId and playerMapId.mapID or currentMapId + end + return playerMapId +end