fix: Sunstrider pin regression, ghost pins, and learner zone normalization
- Fix: isSunstrider block in _MergeSpawnEvidence now checks IsAscensionProtected before writing learner data to npcDataOverrides. Without this guard, each Mana Wyrm kill overwrote AscensionDB's z1241=5 data with learner z3431 coords. - Fix: Clustering disabled for zone 1241 (Sunstrider Isle) in _DrawObjectiveIcons so all 5 AscensionDB spawn pins display individually instead of collapsing to 2. - Fix: Ghost pin loop in AvailableQuests.lua -- 'while frames[i]' was iterating a string-keyed table with a numeric index (never iterated). Changed to pairs(). - Fix: NormalizeSpawnZoneKey now uses ZoneDB.areaIdToUiMapId for all zones so learner evidence is stored under map IDs (e.g. 1241) not area IDs (e.g. 3431), matching AscensionDB's key space. Applied in LearnNPC and _StoreGuidSpawnEvidence. - Fix: isSunstrider detection in _MergeSpawnEvidence updated from hardcoded zoneId==3431 check to IsSunstriderNativeZone() since zone IDs are now normalized to map IDs at storage time.
This commit is contained in:
@@ -31,6 +31,56 @@ end
|
||||
local QuestiePlugin = {}
|
||||
QuestiePlugin.__index = QuestiePlugin
|
||||
|
||||
local function _GetAscensionProtection(dbType)
|
||||
local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
|
||||
QuestieDB.ascensionOverrideKeys = QuestieDB.ascensionOverrideKeys or {}
|
||||
QuestieDB.ascensionOverrideKeys[dbType] = QuestieDB.ascensionOverrideKeys[dbType] or {}
|
||||
return QuestieDB.ascensionOverrideKeys[dbType]
|
||||
end
|
||||
|
||||
local function _IsAscensionProtected(dbType, id, key)
|
||||
local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
|
||||
local protected = QuestieDB.ascensionOverrideKeys
|
||||
and QuestieDB.ascensionOverrideKeys[dbType]
|
||||
and QuestieDB.ascensionOverrideKeys[dbType][id]
|
||||
|
||||
return protected and protected[key] == true
|
||||
end
|
||||
|
||||
local function _ProtectAscensionField(dbType, id, key)
|
||||
local protectedByType = _GetAscensionProtection(dbType)
|
||||
protectedByType[id] = protectedByType[id] or {}
|
||||
protectedByType[id][key] = true
|
||||
end
|
||||
|
||||
local function _MergeEntry(target, id, entry, sourceName, dbType)
|
||||
if type(target) ~= "table" or type(entry) ~= "table" then return end
|
||||
|
||||
local existing = target[id]
|
||||
if type(existing) ~= "table" then
|
||||
target[id] = entry
|
||||
if sourceName == "Ascension" then
|
||||
local key = next(entry)
|
||||
while key do
|
||||
_ProtectAscensionField(dbType, id, key)
|
||||
key = next(entry, key)
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local key, value = next(entry)
|
||||
while key do
|
||||
if sourceName == "Ascension" or not _IsAscensionProtected(dbType, id, key) then
|
||||
existing[key] = value
|
||||
if sourceName == "Ascension" then
|
||||
_ProtectAscensionField(dbType, id, key)
|
||||
end
|
||||
end
|
||||
key, value = next(entry, key)
|
||||
end
|
||||
end
|
||||
|
||||
--- Registers a new Questie plugin
|
||||
---@param pluginName string The unique name of the plugin
|
||||
---@return table|nil plugin The initialized plugin object, or nil if already registered
|
||||
@@ -104,7 +154,7 @@ function QuestiePlugin:InjectDatabase(dbType, data)
|
||||
|
||||
local qid, entry = next(data)
|
||||
while qid do
|
||||
targetOverride[qid] = entry
|
||||
_MergeEntry(targetOverride, qid, entry, self.name, dbType)
|
||||
if type(qid) == "number" then
|
||||
count = count + 1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user