From af2278da6bbb8cc1034ce5b178f2ce4df7a18f58 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 20 Apr 2025 12:08:25 +0200 Subject: [PATCH] libpredict: add support for on-self in cast hook --- libs/libpredict.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 3a96f293..4eff7bb5 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -408,9 +408,12 @@ hooksecurefunc("CastSpellByName", function(effect, target) local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player") + target = target and type(target) == "string" and UnitName(target) or target + target = target and target == 1 and UnitName("player") or target + spell_queue[1] = effect spell_queue[2] = effect.. ( rank or "" ) - spell_queue[3] = target and UnitName(target) or mouseover or default + spell_queue[3] = target or mouseover or default end, true) local scanner = libtipscan:GetScanner("prediction")