diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 8a47b7dc..b157869d 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -834,7 +834,6 @@ local pendingHots = {} -- Gather Data by User Actions hooksecurefunc("CastSpell", function(id, bookType) - if not libpredict.sender.enabled then return end local effect, rank = libspell.GetSpellInfo(id, bookType) if not effect then return end spell_queue[1] = effect @@ -887,7 +886,6 @@ hooksecurefunc("CastSpell", function(id, bookType) end) hooksecurefunc("CastSpellByName", function(effect, target) - if not libpredict.sender.enabled then return end local effect, rank = libspell.GetSpellInfo(effect) if not effect then return end @@ -951,7 +949,6 @@ hooksecurefunc("CastSpellByName", function(effect, target) end) hooksecurefunc("UseAction", function(slot, target, selfcast) - if not libpredict.sender.enabled then return end if not IsCurrentAction(slot) then return end local kind, id = GetActionInfo(slot) local effect, rank @@ -1012,8 +1009,10 @@ hooksecurefunc("UseAction", function(slot, target, selfcast) end) libpredict.sender = CreateFrame("Frame", "pfPredictionSender", UIParent) +-- cleared when a HealComm addon already broadcasts this player's casts libpredict.sender.enabled = true libpredict.sender.SendHealCommMsg = function(self, msg) + if not self.enabled then return end -- Smart channel selection: Only send to relevant channel to avoid duplicates if IsInRaid() then -- In raid: Only send to RAID (includes all raid members) @@ -1026,6 +1025,7 @@ libpredict.sender.SendHealCommMsg = function(self, msg) -- BG groups are handled by RAID channel end libpredict.sender.SendResCommMsg = function(self, msg) + if not self.enabled then return end -- Smart channel selection: Only send to relevant channel to avoid duplicates if IsInRaid() then -- In raid: Only send to RAID (includes all raid members) diff --git a/modules/thirdparty-vanilla.lua b/modules/thirdparty-vanilla.lua index da1c195e..710c7698 100644 --- a/modules/thirdparty-vanilla.lua +++ b/modules/thirdparty-vanilla.lua @@ -1172,21 +1172,9 @@ pfUI:RegisterModule("thirdparty-vanilla", function() end) local EnableHealComm = function() - -- hook healcomm's addon message to parse single-player events + -- HealComm-1.0 already broadcasts this player's casts: keep libpredict + -- tracking them, but stop it sending a second copy if AceLibrary and AceLibrary:HasInstance("HealComm-1.0") and pfUI.api.libpredict then - local HealComm = AceLibrary("HealComm-1.0") - - -- use pfUI frames to draw healComm predictions - local pfHookHealCommSendAddonMessage = HealComm.SendAddonMessage - function HealComm.SendAddonMessage(this, msg) - if not IsInGroup() then - libpredict:ParseChatMessage(UnitName("player"), msg, "HealComm") - end - pfHookHealCommSendAddonMessage(this, msg) - end - - -- disable pfUI predictions - pfUI.api.libpredict.sender:UnregisterAllEvents() pfUI.api.libpredict.sender.enabled = nil end end