From 4ecff60ea872cc572f871cd0c2a92b668af7c56f Mon Sep 17 00:00:00 2001 From: Ludovicus Date: Thu, 26 Nov 2020 08:16:38 -0500 Subject: [PATCH] HBD's GetPlayerZonePosition() seems laggy. Roll our own for now. --- TomTom_POIIntegration.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua index 622fdf1..c53c624 100755 --- a/TomTom_POIIntegration.lua +++ b/TomTom_POIIntegration.lua @@ -43,7 +43,20 @@ local function ObjectivesChanged() scanning = true end - local px, py, map, mapType = hbd:GetPlayerZonePosition(true) + local map = C_Map.GetBestMapForUnit("player") + if not map then + scanning = false + return + end + + local player = C_Map.GetPlayerMapPosition(map, "player") + if not player then + scanning = false + return + end + + local px, py = player:GetXY() + -- Bail out if we can't get the player's position if not px or not py or px <= 0 or py <= 0 then scanning = false @@ -58,7 +71,7 @@ local function ObjectivesChanged() local closestdist = math.huge -- This function relies on the above CVar being set, and updates the icon - -- position information so it can be queries via the API + -- position information so it can be queried via the API QuestPOIUpdateIcons() -- Scan through every quest that is tracked, and find the closest one -- 1.7.9.5