fix: real-time minimap pins + defensive GetAchievementNumCriteria shim

1. _InvalidateSpawnListsForNPC was setting objective.AlreadySpawned = nil,
   causing _DetermineIconsToDraw to crash on nil-index when trying to draw
   updated pins. The xpcall wrapper in UpdateObjectiveNotes swallowed the
   error silently, so no icons appeared.

   Fix: unload existing map/minimap icons explicitly, then set
   AlreadySpawned = {} (empty table) instead of nil. Also clear
   hasRegisteredTooltips so tooltips refresh.

2. Added GetAchievementNumCriteria defensive shim for Ascension servers
   with incomplete achievement databases. Returns 0 for invalid IDs
   instead of hard-erroring in Blizzard's WorldMapFrame.
This commit is contained in:
Xurkon
2026-05-16 08:54:52 -05:00
parent d3bcb6da49
commit 810ea7f802
2 changed files with 52 additions and 5 deletions
+18
View File
@@ -604,6 +604,24 @@ QuestieCompat.IsAchievementCompleted = QuestieCompat.IsAchievementCompleted or f
return completed or false
end
--- GetAchievementNumCriteria Shim
-- Ascension and some custom servers have incomplete achievement databases.
-- Blizzard's WorldMapFrame calls this with invalid IDs, causing a hard error.
-- Wrap the global to return 0 for invalid inputs so the UI doesn't break.
do
local _original = GetAchievementNumCriteria
GetAchievementNumCriteria = function(achievementID)
if type(achievementID) ~= "number" or achievementID <= 0 then
return 0
end
local ok, numCriteria = pcall(_original, achievementID)
if ok then
return numCriteria or 0
end
return 0
end
end
--- LibUIDropDownMenu Shim
QuestieCompat.LibUIDropDownMenu = QuestieCompat.LibUIDropDownMenu or {}
QuestieCompat.LibUIDropDownMenu.UIDropDownMenu_Menu_NewSize = function()