From 961b186491a5ad82ed747521ab9d9edd814850cc Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 5 Feb 2023 14:03:01 +0100 Subject: [PATCH] mouseover: detect self cast to avoid target switch If a self cast is detected, the SpellTargetUnit() function will be used to avoid a target change. Auto-attacks now continue on self casts because the target has no longer to be changed. --- modules/mouseover.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/mouseover.lua b/modules/mouseover.lua index 7eacce86..3e8a117b 100644 --- a/modules/mouseover.lua +++ b/modules/mouseover.lua @@ -19,9 +19,14 @@ pfUI:RegisterModule("mouseover", "vanilla", function () end end - if UnitIsUnit("target", unit) then oldt = nil end - - TargetUnit(unit) + if UnitIsUnit("target", unit) then + oldt = nil + elseif not func and UnitIsUnit("player", unit) then + SpellTargetUnit("player") + oldt = nil + else + TargetUnit(unit) + end if func then func()