From 0ef3bd0148b818ab48cce5edaf0d07f6a0832f47 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Sat, 11 Apr 2026 21:49:54 +0200 Subject: [PATCH] fixed a bug where targeting an offline player predicted heals on them --- libs/libpredict.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 50f3e227..1697b6cf 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -200,10 +200,15 @@ pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGu local pending = pfUI.libpredict_pending_cast if pending and pending.spellName == spellName and pending.targetGuid and pending.time and (GetTime() - pending.time) < 1 then - local name = UnitName(pending.targetGuid) - if name and name ~= UNKNOWNOBJECT and name ~= UKNOWNBEING then - pendingTarget = name - pendingTargetGuid = pending.targetGuid + -- If SPELL_CAST_EVENT target differs from SPELL_START_SELF target, + -- the client redirected the cast (e.g. offline target → selfcast). + -- Discard pending and trust the actual targetGuid from SPELL_START_SELF. + if pending.targetGuid == targetGuid then + local name = UnitName(pending.targetGuid) + if name and name ~= UNKNOWNOBJECT and name ~= UKNOWNBEING then + pendingTarget = name + pendingTargetGuid = pending.targetGuid + end end pending.spellId = nil pending.spellName = nil