From 2b4d33d46a02b4640c3f43e1bf95afe780ff5ffd Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Thu, 29 Oct 2026 18:56:51 -0500 Subject: [PATCH] Keep libpredict tracking casts when HealComm is loaded With HealComm-1.0 present (HealComm, LunaUnitFrames, NotGrid), the compat hook unregistered every event on libpredict.sender to stop pfUI broadcasting a duplicate of the player's casts. Since cast detection moved onto that frame's UNIT_SPELLCAST_* handlers, that also blinded libpredict to every cast, so the player's own resurrections never put the rez icon on the target's frame: ParseChatMessage drops the player's own Resurrection echo, expecting the cast events to have tracked it. The compat hook now only mutes the outgoing HealComm and CTRA messages. The HealComm.SendAddonMessage hook that parsed the player's own messages while solo goes too, since libpredict tracks its own casts directly. --- libs/libpredict.lua | 6 +++--- modules/thirdparty-vanilla.lua | 16 ++-------------- 2 files changed, 5 insertions(+), 17 deletions(-) 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