Questie

Questie

128M Downloads

TomTom not working correctly because QuestieMap:GetNearestQuestSpawn 2nd return value is not a consistent type of id

Mattyspatty opened this issue ยท 2 comments

commented

Description

QuestieMap:GetNearestQuestSpawn is returning AreaIds in most cases, but returning UiMapIds for completed quests due to using QuestieMap:FindClosestFinisher, which returns a UiMapId. This is causing issues with TrackerUtils:SetTomTomTarget as it is expects an AreaId


Quick fix for any readers (only tested in Cata), inside Questie/Modules/Map/QuestieMap.lua

Change line 845

local playerZone = HBD:GetPlayerWorldPosition();

to

local playerZone = C_Map.GetBestMapForUnit("player");

AND change line 952

return {closestFinisher.x, closestFinisher.y}, closestFinisher.zone, closestFinisher.name

to

closestFinisher.zone = ZoneDB:GetAreaIdByUiMapId(closestFinisher.zone);
return {closestFinisher.x, closestFinisher.y}, closestFinisher.zone, closestFinisher.name

Questie version

10.7.1

Game flavor

Cata

commented

Ha, thanks for bringing this up @Mattyspatty

Actually I just started to refactor the entire "find closest X" stuff in #6653

I think I already fixed the second point of yours, but didn't notice the first one. I'll make sure to look into that as well!

Feel free to test the PR and provide feedback <3

commented

No problem buddy. The zone thing is in QuestieMap:FindClosestStarter, just in case you missed that too

I'll have a play with the PR, thanks!