From 3e18f51551adc3943c0cd1a1280f56c8a282a734 Mon Sep 17 00:00:00 2001 From: Xurkon Date: Mon, 16 Mar 2026 22:21:14 -0500 Subject: [PATCH] fix: WotLKDB plugin.stats updated directly in LoadBaseDB so panel shows counts without timing dependency --- Modules/QuestieInit.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Modules/QuestieInit.lua b/Modules/QuestieInit.lua index 99fdef5..a0cf4d0 100644 --- a/Modules/QuestieInit.lua +++ b/Modules/QuestieInit.lua @@ -466,8 +466,20 @@ function QuestieInit:LoadBaseDB() } Questie:Debug(Questie.DEBUG_DEVELOP, "[DBDiag] WotLKDB pull: quest=" .. tostring(_pulled.quest) .. " npc=" .. tostring(_pulled.npc) .. " obj=" .. tostring(_pulled.object) .. " item=" .. tostring(_pulled.item)) - -- Persist counts so WotLKDB Loader.lua can populate plugin.stats after PLAYER_LOGIN + -- Push counts directly onto the plugin object so the Database panel always shows them, + -- regardless of when the panel is opened relative to the async coroutine. + -- Also persist in _G as a fallback for anything that reads it directly. _G.QuestieX_WotLKDB_Counts = _counts + local QuestiePluginAPI = QuestieLoader:ImportModule("QuestiePluginAPI") + if QuestiePluginAPI then + local wotlkPlugin = QuestiePluginAPI:GetPlugin("WotLKDB") + if wotlkPlugin then + wotlkPlugin.stats.QUEST = _counts.QUEST + wotlkPlugin.stats.NPC = _counts.NPC + wotlkPlugin.stats.OBJECT = _counts.OBJECT + wotlkPlugin.stats.ITEM = _counts.ITEM + end + end QuestieInit:LoadDatabase("npcData") QuestieInit:LoadDatabase("objectData")