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.
This commit is contained in:
Brues
2026-10-29 18:56:51 -05:00
parent 94dcfb3dad
commit 2b4d33d46a
2 changed files with 5 additions and 17 deletions
+3 -3
View File
@@ -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)
+2 -14
View File
@@ -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