Mana Sapphire not detected in bag
jdelvare opened this issue ยท 5 comments
Since today's WotLK update (January 18th, 2022, game version 3.4.1.47612), BoM no longer detects when a Mana Sapphire is already in my bags and keeps prompting me to create a new one.
I updated to 2023.1.4 this morning, this is still broken but with the opposite behavior: BoM no longer prompts to create a Mana Sapphire even when I do not have any in my bags.
I started investigating this issue again today, and I no longer think there's a difference in behavior between version 2023.1.4 and older versions. This is a caching issue, so the behavior depends on the initial state.
If you already have a Mana Sapphire in your bags when you connect to the character, BOM will think the Mana Sapphire is always present in your bag even after you have used all its charges. On the other hand, if there is no Mana Sapphire in your bags when you connect to the character, BOM will think there is never a Mana Sapphire in your bag even after you have conjured one.
I need to look deeper into the code, but I suspect this might be related to missing events. I'm not sure how BOM detects that an item has been created or consumed, but it would make sense that this is event-driven, and I know that the 3.4.1 Classic WotLK update made significant changes in this area.
That was indeed a missing event issue. The following hot-fix works for me:
--- a/BuffomatClassic/Src/Events.lua
+++ b/BuffomatClassic/Src/Events.lua
@@ -26,7 +26,8 @@ eventsModule.GENERIC_UPDATE_EVENTS = {
"PLAYER_ALIVE", "PLAYER_UNGHOST", "INCOMING_RESURRECT_CHANGED",
"UNIT_INVENTORY_CHANGED" }
-eventsModule.EVT_BAG_CHANGED = { "BAG_UPDATE_DELAYED", "TRADE_CLOSED" }
+-- It seems that WotLK 3.4.1 update dropped event "BAG_UPDATE_DELAYED", so use "BAG_UPDATE" instead
+eventsModule.EVT_BAG_CHANGED = { "BAG_UPDATE_DELAYED", "BAG_UPDATE", "TRADE_CLOSED" }
eventsModule.EVT_PARTY_CHANGED = { "GROUP_JOINED", "GROUP_ROSTER_UPDATE",
"RAID_ROSTER_UPDATE", "GROUP_LEFT" }
Beware, this is only lightly tested at the moment, and may have unintended performance or functional side effects. I'm not familiar with the code. Hopefully @kvakvs can comment on this when he has time.