fix(map): unload completed-objective pins deterministically
Completed objectives could leave their map/minimap pins on screen until
turn-in. Pin removal relied solely on _UnloadAlreadySpawnedIcons, which
walks objective.AlreadySpawned; that table desyncs from the live frames
after learner spawn-list invalidation or complete->abandon->reaccept
cycles, so when reset to {} the frames leaked.
Add QuestieMap:UnloadQuestFramesForObjective(questId, objectiveIndex)
which unloads frames off the map's own questIdFrames registry by matching
frame.data.ObjectiveIndex, and call it from every completion path in
PopulateObjective. Restricted to positive standard-objective indices;
SpecialObjectives (sentinel index 0) keep using AlreadySpawned.
This commit is contained in:
@@ -1491,6 +1491,7 @@ function QuestieQuest:PopulateObjective(quest, objectiveIndex, objective, blockI
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP,
|
||||
"[QuestieQuest:PopulateObjective] - No Update fn but objective is complete, unloading icons.")
|
||||
_UnloadAlreadySpawnedIcons(objective)
|
||||
QuestieMap:UnloadQuestFramesForObjective(quest.Id, objectiveIndex)
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -1516,6 +1517,7 @@ function QuestieQuest:PopulateObjective(quest, objectiveIndex, objective, blockI
|
||||
if QuestieQuest.ShouldHideObjective(objective) then
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest:PopulateObjective] HIDDEN by ShouldHideObjective, unloading icons for objIdx:", objectiveIndex)
|
||||
_UnloadAlreadySpawnedIcons(objective)
|
||||
QuestieMap:UnloadQuestFramesForObjective(quest.Id, objectiveIndex)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -1536,6 +1538,7 @@ function QuestieQuest:PopulateObjective(quest, objectiveIndex, objective, blockI
|
||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest:PopulateObjective] SKIPPING objective (completed):",
|
||||
objective.Description, "completed:", tostring(completed), "quest.isComplete:", tostring(quest.isComplete))
|
||||
_UnloadAlreadySpawnedIcons(objective)
|
||||
QuestieMap:UnloadQuestFramesForObjective(quest.Id, objectiveIndex)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user