fix: clear QuestieDB entity caches on live override injection

QuestieDB:GetNPC and GetObject cache results in _QuestieDB.npcCache /
_QuestieDB.objectCache. When LearnNPC / LearnObject injects new spawn
coordinates into npcDataOverrides / objectDataOverrides, the cached
objects still hold stale (empty) spawn data. PopulateObjective rebuilds
spawnList by calling GetNPC/GetObject, but gets the cached empty data.

Fix: clear the relevant cache entry immediately after live injection so
the next GetNPC/GetObject call rebuilds with fresh override data.

This is the root cause of 'pins not showing on kill' — the spawnList
was rebuilt, but from a stale cache that didn't include the new learned
coordinates.
This commit is contained in:
Xurkon
2026-05-16 09:37:38 -05:00
parent 810ea7f802
commit 7f99e7228d
+8
View File
@@ -709,6 +709,10 @@ function QuestieLearner:LearnNPC(npcId, name, level, subName, npcFlags, factionS
end end
end end
end end
-- Clear the compiled DB cache so GetNPC rebuilds with the new override data.
if QuestieDB.private and QuestieDB.private.npcCache then
QuestieDB.private.npcCache[npcId] = nil
end
end end
if isNew then if isNew then
@@ -1060,6 +1064,10 @@ function QuestieLearner:LearnObject(objectId, name)
end end
end end
end end
-- Clear compiled DB cache so GetObject rebuilds with the new override data.
if QuestieDB.private and QuestieDB.private.objectCache then
QuestieDB.private.objectCache[objectId] = nil
end
end end
if isNew then if isNew then