fix: check playerUiMapId for custom zones in arrow target selection

This commit is contained in:
Xurkon
2026-03-29 00:02:23 -05:00
parent 140eeedc99
commit 33ced25e63
2 changed files with 18 additions and 5 deletions
+5 -4
View File
@@ -397,6 +397,7 @@ function QuestieArrow:UpdateNearestTargets()
-- Auto mode logic: If autoTrack is on OR NOTHING is tracked -- Auto mode logic: If autoTrack is on OR NOTHING is tracked
local usingAutoLogic = Questie.db.profile.autoTrackQuests or not hasTracked local usingAutoLogic = Questie.db.profile.autoTrackQuests or not hasTracked
local playerZoneId = QuestiePlayer:GetCurrentZoneId() local playerZoneId = QuestiePlayer:GetCurrentZoneId()
local playerUiMapId = QuestiePlayer:GetCurrentUiMapId()
local function _CollectQuestTargets(quest) local function _CollectQuestTargets(quest)
if not quest then if not quest then
@@ -473,7 +474,7 @@ function QuestieArrow:UpdateNearestTargets()
local x = value[2] local x = value[2]
local y = value[3] local y = value[3]
-- Auto Logic: Hide distant quests (different zone) -- Auto Logic: Hide distant quests (different zone)
if not (usingAutoLogic and zone ~= playerZoneId) then if not (usingAutoLogic and zone ~= playerZoneId and zone ~= playerUiMapId) then
local uiMapId = ZoneDB:GetUiMapIdByAreaId(zone) local uiMapId = ZoneDB:GetUiMapIdByAreaId(zone)
if uiMapId and x and y then if uiMapId and x and y then
local targetX, targetY, targetInstance = HBD:GetWorldCoordinatesFromZone(x / 100.0, y / 100.0, uiMapId) local targetX, targetY, targetInstance = HBD:GetWorldCoordinatesFromZone(x / 100.0, y / 100.0, uiMapId)
@@ -494,7 +495,7 @@ function QuestieArrow:UpdateNearestTargets()
end end
else else
-- Auto Logic: Hide distant quests (different zone) -- Auto Logic: Hide distant quests (different zone)
if not (usingAutoLogic and finisherZone ~= playerZoneId) then if not (usingAutoLogic and finisherZone ~= playerZoneId and finisherZone ~= playerUiMapId) then
local x = coords[1] local x = coords[1]
local y = coords[2] local y = coords[2]
local uiMapId = ZoneDB:GetUiMapIdByAreaId(finisherZone) local uiMapId = ZoneDB:GetUiMapIdByAreaId(finisherZone)
@@ -523,7 +524,7 @@ function QuestieArrow:UpdateNearestTargets()
if finisher.waypoints then if finisher.waypoints then
for zone, waypoints in pairs(finisher.waypoints) do for zone, waypoints in pairs(finisher.waypoints) do
-- Auto Logic: Hide distant quests (different zone) -- Auto Logic: Hide distant quests (different zone)
if not (usingAutoLogic and zone ~= playerZoneId) then if not (usingAutoLogic and zone ~= playerZoneId and zone ~= playerUiMapId) then
if waypoints and waypoints[1] and waypoints[1][1] and waypoints[1][1][1] then if waypoints and waypoints[1] and waypoints[1][1] and waypoints[1][1][1] then
local x = waypoints[1][1][1] local x = waypoints[1][1][1]
local y = waypoints[1][1][2] local y = waypoints[1][1][2]
@@ -572,7 +573,7 @@ function QuestieArrow:UpdateNearestTargets()
if spawnData and spawnData.Spawns then if spawnData and spawnData.Spawns then
for zone, spawns in pairs(spawnData.Spawns) do for zone, spawns in pairs(spawnData.Spawns) do
-- Auto Logic: Hide distant quests (different zone) -- Auto Logic: Hide distant quests (different zone)
if not (usingAutoLogic and zone ~= playerZoneId) then if not (usingAutoLogic and zone ~= playerZoneId and zone ~= playerUiMapId) then
for _, spawn in pairs(spawns) do for _, spawn in pairs(spawns) do
local uiMapId = ZoneDB:GetUiMapIdByAreaId(zone) local uiMapId = ZoneDB:GetUiMapIdByAreaId(zone)
if uiMapId then if uiMapId then
+13 -1
View File
@@ -112,12 +112,24 @@ end
function QuestiePlayer:GetCurrentZoneId() function QuestiePlayer:GetCurrentZoneId()
local uiMapId = C_Map.GetBestMapForUnit("player") local uiMapId = C_Map.GetBestMapForUnit("player")
if uiMapId then if uiMapId then
return ZoneDB:GetAreaIdByUiMapId(uiMapId) local areaId = ZoneDB:GetAreaIdByUiMapId(uiMapId)
if areaId then
return areaId
end
return uiMapId
end end
return ZoneDB.instanceIdToUiMapId[select(8, GetInstanceInfo())] return ZoneDB.instanceIdToUiMapId[select(8, GetInstanceInfo())]
end end
function QuestiePlayer:GetCurrentUiMapId()
local uiMapId = C_Map.GetBestMapForUnit("player")
if uiMapId then
return uiMapId
end
return ZoneDB.instanceIdToUiMapId[select(8, GetInstanceInfo())]
end
---@return number ---@return number
function QuestiePlayer:GetCurrentContinentId() function QuestiePlayer:GetCurrentContinentId()
local currentZoneId = QuestiePlayer:GetCurrentZoneId() local currentZoneId = QuestiePlayer:GetCurrentZoneId()