fix(learner): defer to AscensionDB curated spawns for owned NPCs

Mana Wyrm 15274 (quest 8325) pins rendered in the NE corner because the
learner's Sunstrider spawns leaked into the curated AscensionDB coords.
Root causes:
- In learner mode GetNPC uses rawdata = learner record, and _MergeOverride
  deep-merges spawn tables, so the learner's bad zone (1445 @ 54,12)
  survived since AscensionDB had no entry to displace it.
- The injection guards used IsAscensionProtected(), which returns false in
  learner mode, so the learner overrode AscensionDB-owned spawns. Commit
  0f20ea8 had also added a (not learnerLiveMode) bypass to the
  _MergeSpawnEvidence Sunstrider guard, re-enabling the e80a008 regression.

Fixes:
- QuestieDB.GetNPC: for AscensionDB-owned NPC spawns (direct
  ascensionOverrideKeys check), use ONLY the curated override spawns and
  discard the merged learner zones.
- New mode-independent AscensionOwnsNpcSpawns() helper; used by the
  InjectLearnedData spawn restore and the _MergeSpawnEvidence guard
  (removed the (not learnerLiveMode) bypass).

Regression test asserts GetNPC returns only the curated 1241 coords and
drops the learner 1445 zone.
This commit is contained in:
Xurkon
2026-06-08 17:53:16 -05:00
parent a525813f12
commit 011cdb58a9
3 changed files with 43 additions and 5 deletions
+19
View File
@@ -2314,6 +2314,25 @@ function QuestieDB:GetNPC(npcId)
end
end
-- AscensionDB hand-curates spawn coordinates for Ascension-specific zones
-- (e.g. Sunstrider's Mana Wyrm 15274). When AscensionDB owns this NPC's spawns,
-- use ONLY those curated coords and discard the learner-record zones that
-- _MergeOverride deep-merged in: the learner's Sunstrider coords are frequently
-- stored under the wrong map/zone (Sunstrider 1241 vs Eversong space), which
-- otherwise leaks in as pins in the wrong corner of the map. In learner mode
-- rawdata IS the learner record, so the bad zone survives the merge because
-- AscensionDB has no entry to displace it — this check removes it. Direct
-- ascensionOverrideKeys lookup (NOT IsAscensionProtected, which returns false
-- in learner mode).
if override and QuestieDB.ascensionOverrideKeys and QuestieDB.ascensionOverrideKeys["NPC"]
and QuestieDB.ascensionOverrideKeys["NPC"][npcId]
and QuestieDB.ascensionOverrideKeys["NPC"][npcId][7] then
local curated = override[7] or override.spawns
if curated and next(curated) then
npc.spawns = CopySpawnTable(curated)
end
end
local friendlyToFaction = npc.friendlyToFaction
npc.friendly = (not friendlyToFaction) and true or factionReactions[friendlyToFaction]