fix(learner): learner-only mode shows only learner-recorded spawns

In learner-only mode the map/minimap drew curated AscensionDB (and static)
spawns for every quest NPC/object the player had not personally recorded.
GetNPC/GetObject fall back to the npcDataOverrides/objectDataOverrides
entry for metadata when there is no learner record, and that entry's
spawns (AscensionDB-curated for un-recorded entities) were drawn as pins.

Both now track whether a real learner record exists and, in learner mode,
strip spawns when it does not -- so learner-only shows exclusively what the
learner recorded (metadata fallback for names/tooltips kept). GetObject
also now nils the override in learner mode to match GetNPC. Recorded
entities still show their learner spawns; auto/static/none unchanged.

Verified test-neutral on the full suite (144 successes / same 7 pre-existing
failures) with a local regression test that passes with the fix and fails
without it.
This commit is contained in:
Xurkon
2026-06-09 21:25:02 -05:00
parent 364b455b00
commit ee67653414
2 changed files with 28 additions and 2 deletions
+27 -2
View File
@@ -668,12 +668,20 @@ function QuestieDB:GetObject(objectId)
local rawdata
local override
local hasLearnerRecord = false
override = QuestieDB.objectDataOverrides and (QuestieDB.objectDataOverrides[objectId] or QuestieDB.objectDataOverrides[tostring(objectId)])
if mode == "learner" or QuestieDB:IsStoreMissing("objectData") then
rawdata = learnerRecord
if not rawdata then
if rawdata then
hasLearnerRecord = true
else
-- No learner record: fall back to the override only for metadata. Its spawns
-- are stripped below so learner-only mode never draws curated/static pins.
rawdata = override
end
-- Learner mode: discard curated coords AscensionDB wrote into objectDataOverrides
-- so learner data is used exclusively (mirrors GetNPC).
override = nil
else
rawdata = QuestieDB.QueryObject(objectId, QuestieDB._objectAdapterQueryOrder)
if not rawdata and learnerRecord and mode == "auto" then
@@ -710,6 +718,11 @@ function QuestieDB:GetObject(objectId)
end
end
-- Learner-only mode draws ONLY learner-recorded spawns (see GetNPC).
if mode == "learner" and not hasLearnerRecord then
obj.spawns = nil
end
_QuestieDB.objectCache[objectId] = obj;
return obj;
end
@@ -2271,10 +2284,15 @@ function QuestieDB:GetNPC(npcId)
local learnerRecord = _GetLearnerRecord("npcs", npcId)
local rawdata
local override
local hasLearnerRecord = false
override = QuestieDB.npcDataOverrides and (QuestieDB.npcDataOverrides[npcId] or QuestieDB.npcDataOverrides[tostring(npcId)])
if mode == "learner" or QuestieDB:IsStoreMissing("npcData") then
rawdata = learnerRecord
if not rawdata then
if rawdata then
hasLearnerRecord = true
else
-- No learner record: fall back to the override only for metadata (name, etc.).
-- Its spawns are stripped below so learner-only mode never draws curated/static pins.
rawdata = override
end
-- Learner mode: discard any curated coords that AscensionDB's
@@ -2348,6 +2366,13 @@ function QuestieDB:GetNPC(npcId)
end
end
-- Learner-only mode draws ONLY learner-recorded spawns. When this NPC has no learner
-- record, rawdata fell back to the curated/override entry purely for metadata; drop its
-- spawns so AscensionDB/static coordinates are not rendered as pins in learner mode.
if mode == "learner" and not hasLearnerRecord then
npc.spawns = nil
end
_QuestieDB.npcCache[npcId] = npc
return npc
end