diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 4969b17c..c2fbc15a 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -320,9 +320,12 @@ 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 + local mouseover = pfUI and pfUI.uf and pfUI.uf.mouseover.name + local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player") + spell_queue[1] = effect spell_queue[2] = effect.. ( rank or "" ) - spell_queue[3] = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player") + spell_queue[3] = mouseover or default end, true) local scanner = libtipscan:GetScanner("prediction") diff --git a/modules/mouseover.lua b/modules/mouseover.lua index a9906a95..e6cc7c1b 100644 --- a/modules/mouseover.lua +++ b/modules/mouseover.lua @@ -69,15 +69,21 @@ pfUI:RegisterModule("mouseover", "vanilla", function () if func then func() else + -- write temporary unit name + pfUI.uf.mouseover.name = UnitName(unit) + -- cast without self cast cvar setting -- to allow spells to use spelltarget NoSelfCast(msg) -- set spell target to unitstring (or selfcast) - if SpellIsTargeting() then SpellTargetUnit((unitstr or "player")) end + if SpellIsTargeting() then SpellTargetUnit(unitstr or "player") end -- clean up spell target in error case if SpellIsTargeting() then SpellStopTargeting() end + + -- remove temporary mouseover unit + pfUI.uf.mouseover.name = nil end if restore_target then