diff --git a/Compat/HBD.lua b/Compat/HBD.lua index 66eee0c..33396a0 100644 --- a/Compat/HBD.lua +++ b/Compat/HBD.lua @@ -52,8 +52,12 @@ QuestieCompat.HBD = HBD -- 33-38%/18-25% range, which maps to Sunstrider's location WITHIN Eversong -- -- ZONE_REDIRECT: used by ResolveZone() for visibility logic (isSameZoneSpace). +-- NOTE: 1241 is NOT redirected to 1941. Map 1241 (Sunstrider) has its own +-- calibrated bounds that produce a different world coordinate space than +-- Eversong. Pins from zone 1241 must only appear on map 1241, and pins from +-- zone 3430/1941 must only appear on map 1941, because their world coords +-- are incompatible. The arrow handles 1241→1941 conversion internally. local ZONE_REDIRECT = { - [1241] = 1941, -- Sunstrider Isle -> Eversong Woods (shared visibility space) [946] = 1941, -- Ghost/transition map -> Eversong Woods (for Sunstrider loading) } @@ -137,9 +141,10 @@ end) --- @param y Y position in 0-1 point coordinates --- @param zone uiMapID of the zone function HBD:GetWorldCoordinatesFromZone(x, y, zone) - -- Ascension: mapData[1241] and [946] have been overridden with Eversong bounds - -- at startup, so coordinate calls for these zones now use Eversong's coordinate - -- space naturally. No redirect needed here. + -- Ascension: mapData[946] has been overridden with Eversong bounds. + -- mapData[1241] has its own calibrated bounds that match the game engine's + -- Sunstrider coordinate space. Both convert through their own bounds — + -- no redirect needed here because _ResolveMapUiMapId passes 1241 through. local data = mapData[zone] if not data or data[1] == 0 or data[2] == 0 then -- Attempt to lazy-load the real HBD if we haven't yet @@ -167,9 +172,9 @@ end --- @param zone uiMapID of the zone --- @param allowOutOfBounds Allow coordinates to go beyond the current map (ie. outside of the 0-1 range), otherwise nil will be returned function HBD:GetZoneCoordinatesFromWorld(x, y, zone, allowOutOfBounds) - -- Ascension: mapData[1241] and [946] have been overridden with Eversong bounds - -- at startup, so coordinate calls for these zones now use Eversong's coordinate - -- space naturally. No redirect needed here. + -- Ascension: mapData[946] has been overridden with Eversong bounds. + -- mapData[1241] has its own calibrated bounds matching the engine's space. + -- No redirect needed — callers pass the correct zone directly. local data = mapData[zone] if not data or data[1] == 0 or data[2] == 0 then if not RealHBD then @@ -743,9 +748,9 @@ local function HandleWorldMapPin(icon, data) end -- translate coordinates - -- Ascension: mapData[1241] and [946] have been overridden with Eversong bounds, - -- so cross-zone pin positioning (e.g., Eversong 1941 pins on Sunstrider 1241 map) - -- works naturally — both zones share the same coordinate space. + -- Ascension: mapData[1241] has calibrated Sunstrider bounds matching + -- the game engine's coordinate space. Pins on zone 1241 use these + -- bounds for world coord conversion, so they align with the player. x, y = HBD:GetZoneCoordinatesFromWorld(data.x, data.y, uiMapID) -- [HBD-Pins] pin position debug disabled end diff --git a/Database/Zones/zoneDB.lua b/Database/Zones/zoneDB.lua index 02e98aa..d615d85 100644 --- a/Database/Zones/zoneDB.lua +++ b/Database/Zones/zoneDB.lua @@ -52,8 +52,7 @@ local UiMapIdOverrides = { [1415] = 668, -- Eastern Kingdoms (matches Undercity on Ascension) -- [1241] intentionally NOT overridden: areaId 3430 = Eversong Woods (the whole zone), -- and should map to uiMapId 1941 (Eversong map) for proper coordinate rendering. - -- Sunstrider sub-zone pins are handled via ZONE_REDIRECT in HBD.lua (visibility) - -- and _ResolveMapUiMapId in QuestieMap.lua (coordinate conversion). + -- Zone 1241 pins render on map 1241 only (separate coordinate space from Eversong). [1238] = 668, -- Northshire Valley child map (Conquest of Azeroth) -- [946] = 668 removed: both Sunstrider Isle AND Northshire Valley use 946 as ghost/zone map, -- so 946 cannot be overridden to a single zone. Instead, uiMapIdToAreaIdCache handles both. @@ -78,8 +77,10 @@ areaIdToUiMapId[668] = 1238 -- Pins for zone 1241 render on map 1241 (Sunstrider) using Ascension-calibrated bounds. ZoneDB.private.areaIdToUiMapId[3430] = 1941 areaIdToUiMapId[3430] = 1941 -ZoneDB.private.areaIdToUiMapId[3431] = 1941 -areaIdToUiMapId[3431] = 1941 +-- Sunstrider Isle (3431) uses its own map (1241) with calibrated bounds. +-- Pins for Sunstrider NPCs (zone 1241 coords) must appear on map 1241, not 1941. +ZoneDB.private.areaIdToUiMapId[3431] = 1241 +areaIdToUiMapId[3431] = 1241 -- Allow drawing pins directly on Sunstrider Isle (uiMapId 1241) via areaId 1241. ZoneDB.private.areaIdToUiMapId[1241] = 1241 areaIdToUiMapId[1241] = 1241 diff --git a/Database/compiler.lua b/Database/compiler.lua index fb353d4..bcb0c1c 100644 --- a/Database/compiler.lua +++ b/Database/compiler.lua @@ -1439,10 +1439,16 @@ function QuestieDBCompiler:GetDBHandle(data, pointers, skipMap, keyToRootIndex, ---@param key string ---@return any handle.QuerySingle = function(id, key) - local override = overrides[id] - if override then + -- Check override first for custom server data + if overrides and overrides[id] then local kti = keyToRootIndex[key] - if kti and override[kti] ~= nil then return override[kti] end + if kti then + local overrideVal = overrides[id][kti] + -- Only use override if it has actual data (not nil, not empty table) + if overrideVal ~= nil and not (type(overrideVal) == "table" and next(overrideVal) == nil) then + return overrideVal + end + end end local ptr = pointers[id] if not ptr then diff --git a/Modules/Map/QuestieMap.lua b/Modules/Map/QuestieMap.lua index 1b1a613..fb098b1 100644 --- a/Modules/Map/QuestieMap.lua +++ b/Modules/Map/QuestieMap.lua @@ -62,8 +62,10 @@ local function _ResolveMapUiMapId(uiMapId, x, y) if uiMapId == 946 then return 1941 end - -- Map 1241 (Sunstrider Isle) now has its own Ascension-calibrated bounds - -- and pins on 1241 render correctly on the Sunstrider sub-map. No redirect. + -- Map 1241 (Sunstrider Isle): the game engine returns player world + -- coordinates in Sunstrider space (mapData[1241] calibrated bounds). + -- Pins MUST also convert through mapData[1241] so they share the same + -- world space as the player on the minimap. Do NOT redirect to 1941. return uiMapId end diff --git a/Modules/Tooltips/MapIconTooltip.lua b/Modules/Tooltips/MapIconTooltip.lua index 59ec518..5ebc222 100644 --- a/Modules/Tooltips/MapIconTooltip.lua +++ b/Modules/Tooltips/MapIconTooltip.lua @@ -503,23 +503,25 @@ function MapIconTooltip:Show() local minLevel = creatureLevels[name][1] local maxLevel = creatureLevels[name][2] local rank = creatureLevels[name][3] - if minLevel == maxLevel then - levelString = name .. " (" .. minLevel - else - levelString = name .. " (" .. minLevel .. "-" .. maxLevel - end + if minLevel and maxLevel then + if minLevel == maxLevel then + levelString = name .. " (" .. minLevel + else + levelString = name .. " (" .. minLevel .. "-" .. maxLevel + end - if rank and rank == 1 then - levelString = levelString .. "+" - elseif rank and rank == 2 then - levelString = levelString .. " " .. l10n("Rare Elite") - elseif rank and rank == 3 then - levelString = levelString .. " Boss" - elseif rank and rank == 4 then - levelString = levelString .. " " .. l10n("Rare") - end + if rank and rank == 1 then + levelString = levelString .. "+" + elseif rank and rank == 2 then + levelString = levelString .. " " .. l10n("Rare Elite") + elseif rank and rank == 3 then + levelString = levelString .. " Boss" + elseif rank and rank == 4 then + levelString = levelString .. " " .. l10n("Rare") + end - levelString = levelString .. ")" + levelString = levelString .. ")" + end end return levelString end