- Add CopySpawnTable and MergeSpawnTables helpers to deep-merge spawn
coordinate lists (zoneId -> {{x,y}, ...}) instead of replacing them
wholesale. Previously an override containing spawns would clobber the
base list, reducing visible pins for any NPC with partial overrides
(Sunstrider Isle calibration, Ascension area-specific fixes, etc.).
- _MergeOverride now special-cases the 'spawns' key to call the merger
with the base spawn table as a fallback when override is empty.
- GetSuppressedNPCs/Objects now check ld.settings.enabled alongside
prioritizeMyData. When the learner is fully disabled, the suppression
pass is skipped entirely (additive and AND-only).
- Fix: isSunstrider block in _MergeSpawnEvidence now checks IsAscensionProtected
before writing learner data to npcDataOverrides. Without this guard, each Mana
Wyrm kill overwrote AscensionDB's z1241=5 data with learner z3431 coords.
- Fix: Clustering disabled for zone 1241 (Sunstrider Isle) in _DrawObjectiveIcons
so all 5 AscensionDB spawn pins display individually instead of collapsing to 2.
- Fix: Ghost pin loop in AvailableQuests.lua -- 'while frames[i]' was iterating a
string-keyed table with a numeric index (never iterated). Changed to pairs().
- Fix: NormalizeSpawnZoneKey now uses ZoneDB.areaIdToUiMapId for all zones so
learner evidence is stored under map IDs (e.g. 1241) not area IDs (e.g. 3431),
matching AscensionDB's key space. Applied in LearnNPC and _StoreGuidSpawnEvidence.
- Fix: isSunstrider detection in _MergeSpawnEvidence updated from hardcoded
zoneId==3431 check to IsSunstriderNativeZone() since zone IDs are now normalized
to map IDs at storage time.
- zoneDB: remap areaId 3431 → uiMapId 1241 (Sunstrider Isle) so quest 8335
pins render on correct map instead of Eversong Woods (1941)
- compat/HBD: remove 1241→1941 redirect (Sunstrider pins now handled by zoneDB)
- compiler: QuerySingle override check skips empty tables (next() guard) so
spawn data overrides don't fall through to nil base DB values
- MapIconTooltip: nil guards for minLevel/maxLevel to prevent crashes
- Map/QuestieMap: remove stale 1241→1941 redirect comment
Two fixes for QuestieLearner real-time pin rendering:
1. _MergeOverride now skips empty tables (IsEmptyTable guard).
QuestieLearner stores spawns={} before any coords are captured.
Previously _MergeOverride treated {} as valid data and replaced the
base DB's real spawn coordinates with an empty table, breaking pins
for all NPCs that had been seen but not killed (mouseovers, etc.).
2. _InvalidateSpawnListsForNPC triggers after LearnNPC adds new spawn data.
The quest objective system caches spawnList once per objective.
When a kill adds new coordinates, the cached list is stale.
The new helper:
- Scans all active quest objectives for references to the NPC
- Clears objective.spawnList and objective.AlreadySpawned
- Calls QuestieQuest:UpdateQuest to rebuild pins with fresh data
This makes learned pins appear in real-time without /reload.
When UpdateNearestTargets uses ZoneDB:GetAreaIdByUiMapId(946) to verify
player zone, it returns 668 (Northshire) instead of 3430 (Sunstrider).
UiMapIdOverrides[946] was set to 668 for Northshire, so 946 always
resolves to Northshire's areaId even on Sunstrider Isle.
Added direct cache entries for both 1241→3430 and 946→3430 in the
uiMapIdToAreaIdCache (the fast-path lookup table) so GetAreaIdByUiMapId
returns the correct Sunstrider Isle areaId regardless of which map ID
the game returns.
- zoneDB.lua: Add [946] = 3430 to UiMapIdOverrides so GetCurrentZoneId()
returns 3430 (Sunstrider Isle areaId) even when the game returns uiMapId 946
(ghost/loading map). Previously 946 had no override, causing zone lookups to
fall through and return 946 instead of the real zone, breaking arrow distance
calculation and target filtering.
- QuestieArrow.lua: UpdateNearestTargets uses QuestiePlayer:GetCurrentUiMapId()
(backed by C_Map.GetBestMapForUnit) for player position. When that returns an
invalid/ghost map (946/947/0), fall back to ZoneDB lookup via the actual
zoneId. This ensures the arrow gets real world coordinates regardless of
whether the world map is open or closed.
Also includes per-frame debug output when debugArrow profile is enabled.
- Tooltip.lua: Add type guard 'if type(objList) ~= table then break end'
before iterating learnedNpc[10] and learnedObj[10] in both m_/NPC and o_/object
paths. Prevents 'attempt to index field questData (a string value)' error
when the questData field is unexpectedly a string instead of a table.
The original loop used 'for questId, objList in next, learnedNpc[10]' which
iterates key-value pairs in insertion order. The _AddToArray helper stores
values as sequential array elements (tbl[key]=value via table.insert), but
the iteration was treating it as a questId->objList map. Fixed to use
ipairs-style iteration with a type check for robustness.
Root cause: _LoadCorrections writes to QuestieDB.objectData (binary DB companion) but GetObject reads from QueryObject binary handle + objectDataOverrides. Items in Load() path are patching the binary DB so never reach GetObject's override check. Moving 176213 to LoadFactionFixes puts it directly in objectDataOverrides, the path GetObject actually reads.
- HBD.lua: Cache GetPlayerWorldPosition/GetPlayerZonePosition at 50ms
intervals instead of hammering GetPlayerMapPosition() every frame.
Invalidate cache on PLAYER_ENTERING_WORLD and ZONE_CHANGED_* events.
Expected ~97% reduction in C API position calls (45,570 -> ~1,200 / 10min).
- zoneDB.lua: Replace O(n) linear scan in GetAreaIdByUiMapId with an
O(1) reverse lookup cache (uiMapIdToAreaIdCache) built at Initialize().
Cache is kept in sync by ApplyCustomZones and name-match fallback now
caches its result so subsequent calls are also O(1).
- Tooltip.lua: Throttle GameTooltip OnUpdate hook to 100ms intervals
(was firing every frame at 60-144 Hz). Added _tooltipLastText cache
to avoid redundant GetText() + CountTooltip() calls when nothing changed.
- QuestieArrow.lua: Hoist _HasMissingCompletedFlag, _GetCompleteIconType,
_CollectFinisherSpawns, and _CollectObjective out of _CollectQuestTargets
to module-level functions. These were re-created as closures on every
UpdateNearestTargets call (1 Hz). Shared per-cycle context is published
via _arrow_* module upvalues to avoid closure capture overhead.
- QuestieLearnerComms.lua: Four micro-optimizations:
(1) Reduce ProcessQueues ticker 0.2s -> 0.5s (still 7x faster than
minChatInterval of 3.5s).
(2) Cache hidden channel ID at init; lazy refresh on disconnect.
(3) Drop LibDeflate compress level 9 -> 1 (fraction of CPU cost).
(4) O(1) messageCacheCount counter replaces O(n) pairs() size scan.
- NPC 5467 (Deep Dweller): Replace single spawn point with 28 locations
scraped from Wowhead covering the eastern Tanaris coast area
- NPC 5470 (Raging Dune Smasher): Was nil in all databases, added 23
spawn locations in the Abyssal Sands (southwest Tanaris)
- Fixes added to both classicNPCFixes.lua and tbcNPCFixes.lua
- Quest 50006 (Sandstone Giants) killCreditObjective already updated in
previous commit to include all 4 giant NPCs (5466, 5467, 5469, 5470)
All four giant types now have correct spawn data for minimap pin display.
In Lua, 0 evaluates as truthy. The check
'if questLogEntry.isComplete then return questLogEntry.isComplete end'
was completely bypassing our fallback completion logic because
GetQuestLogTitle sets isComplete = 0 when a quest is incomplete.
This caused the arrow to still point to requiredSourceItems (like
the Cold Iron Key drops) because the quest was never being flagged
as 'isComplete=true' internally.
Fixed by explicitly checking for isComplete == 1 or isComplete == -1
before returning.
The finished flag in QuestLogCache is only set to true when the server
sends isComplete=1 via GetQuestLogTitle. For quest 12843 ('They Took
Our Men!'), after using all Cold Iron Keys the objectives numerically
complete (5/5) but isComplete=1 may not fire until the player visits
the turn-in NPC.
Use numFulfilled == numRequired as the completion check instead, which
updates from GetQuestLogLeaderBoard immediately when each objective
fills. Added numRequired > 0 guard to avoid trivially matching
zero-required objectives.