Skip to content

Commit

Permalink
Change zone to parentZone mapID
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed May 16, 2024
1 parent 78eb200 commit 5c57915
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion helper/RouteManagement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 5c57915

Please sign in to comment.