From 7f99e7228d13b47d16cde1d28f814e031c64cb8f Mon Sep 17 00:00:00 2001 From: Xurkon Date: Sat, 16 May 2026 09:37:38 -0500 Subject: [PATCH] fix: clear QuestieDB entity caches on live override injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Modules/QuestieLearner.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/QuestieLearner.lua b/Modules/QuestieLearner.lua index 094d4f6..d87edfc 100644 --- a/Modules/QuestieLearner.lua +++ b/Modules/QuestieLearner.lua @@ -709,6 +709,10 @@ function QuestieLearner:LearnNPC(npcId, name, level, subName, npcFlags, factionS 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 if isNew then @@ -1060,6 +1064,10 @@ function QuestieLearner:LearnObject(objectId, name) 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 if isNew then