RequiredSourceItems map icons are not removed after you loot the respective item.
Cabro opened this issue ยท 6 comments
With the recent changes to QIB logic, some quest items are both quest objectives and requiredSourceItems. In this case, the map/minimap icons are not removed after you loot the respective items.
8.8.1 wotlk
Test case: https://www.wowhead.com/wotlk/quest=12981/hot-and-cold
Both [KILL] Brittle Revenant icons and [LOOT] Smoldering Scraps icons show upon accepting this quest on the Map and Mini Map.
Before having enough [Essence of Ice] the [Smoldering Scraps] icons shouldn't be visible.
After looting 6 [Essence of Ice] from killing Brittle Revenant's - the [KILL] icons should disappear.
The only objective for this quest is to obtain 6 [Frozen Iron Scraps] - this is the only data available to us in our DB and from Blizzard API's. We have no way to programmatically check if we have enough drops to finish the objective(s). Some quests require more drops to finish an objective(s) due to failures or some other environmental challenge. We could easily fix this specific quest since the quest description says to collect 6 and to my knowledge, when you use a drop to obtain one of the objectives, the process doesn't fail even if you enter combat. Trouble is not all quests are equal and we can't possibly write custom code for specific quests such as this. If we build logic, then it should be universally applied to all quests that fall in this category.
Unless someone has a brilliant idea... I'm inclined to let this one fly as is. At least if you need more drops... the map icons are still there, and they disappear like they are supposed to once the quest is in a complete state. And they return if you delete one of the [Frozen Iron Scraps]...
As I suggest on discord, just check if the requiredsourceitem is ALSO an actual quest objective. The map icons only remain in that case when they shouldn't.
That is one check that would be needed yes. But there is no objective for [Essence of Ice]. If only one was needed, then that would be easy, but WE know that 6 are needed because we assume 6 are needed from reading the quest description since you need to use one [Essence of Ice] for each [Frozen Iron Scraps]. But there isn't a isNeeded
key embedded in the quest DB for [Essence of Ice] so there is no way for us to know when to trigger a "hide [KILL] Brittle Revenant icons". Like I said, I could fix this test case specifically by building logic that would "hide [KILL] Brittle Revenant icons if #[Essence of Ice] > 5" and then "show [KILL] Brittle Revenant icons if #[Essence of Ice] = 0". The number of needed drops is derived by "human intelligence" or a quick wowhead search and reading comments left by other players on how many they think you'll need to complete the quest. It would be nice if our DB had an optional key to say requiredSourceItemId
= #needed. Then the code logic could be universally applied, and we could set the variable via Quest Corrections.
Another good test case: https://www.wowhead.com/wotlk/quest=11472/the-way-to-his-heart
The Quest description doesn't say how many fish you need and yet, no matter how many fish you gather, those icons remain until after you complete the quest.
I feel like you are focusing on the cases that are not subject to this bug :( those are perfectly fine to leave as they are now. Sometimes you need more items, sometimes fewer of them. It's totally irrelevant to the bug report. The only case where those map icons should be removed is if they are both objectives and requiredsourceitemid . In the examples you gave, that is not the case. They are not both, so they would be excluded from the logic.
And if they are both objectives and requiredsourceitemid then you know exactly how many you need, since it's in the objectives.
I don't recall you saying which quests you had issues with. The above two examples are the only ones I remember encountering with this issue. Remember... my memory is shite.
In order to get QiB's to work for all quest types we're adding itemID's into the sourceItemId
and requiredSourceItems
key to handle the logic for both Primary and Secondary QiB's. Originally, the requiredSourceItems
key was never really meant to handle anything other than to add additional required items for quests that aren't an objective already. Because of this, Questies DB code looks for any itemID in requiredSourceItems
and treats them as SpecialObjectives aka extraObjectives. This includes handling Map and Mini Map icons.
The bug that @Cabro found relates to QuestieDB:GetQuest() creating duplicate Map and Mini Map icons for objectives and SpecialObjectives. In his test case: https://www.wowhead.com/wotlk/quest=1221/blueleaf-tubers - since all three quest items are already objectives, they create their own Map and Mini Map icons. When the player picks up those items, the objective is complete, and the Map and Mini Map icons disappear. Because we're adding two of the itemID's to requiredSourceItems
to handle QiB logic... Map and Mini Map icons are also getting created and since these are a "synthetic" objective, there isn't a way to flag these as complete... leaving behind the Map and Mini Map icons.
My fix is to do a quick loop through the objectives table and compare the itemID's for a match before creating the "synthetic" objective. If there is a match, then it's skipped. This allows us to continue creating "synthetic" objectives for requiredSourceItems
without impacting QiB functionality.
Another test case @Cabro brought to my attention was https://www.wowhead.com/wotlk/quest=2845/wandering-shay. Once Shay's Bell is looted from the chest, the icon is still present. Again, the id for Shay's Bell was inserted into the requiredSourceItems
key to make it appear on the Tracker as a QiB. But it's also an objective. My fix should handle this as well...