mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
prediction: check assist to identify valid unit
This commit is contained in:
+3
-1
@@ -320,7 +320,9 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
|||||||
if not libpredict.sender.enabled then return end
|
if not libpredict.sender.enabled then return end
|
||||||
local effect, rank = libspell.GetSpellInfo(effect)
|
local effect, rank = libspell.GetSpellInfo(effect)
|
||||||
if not effect then return end
|
if not effect then return end
|
||||||
local mouseover = pfUI and pfUI.uf and pfUI.uf.mouseover.name
|
local mouseover = pfUI and pfUI.uf and pfUI.uf.mouseover.unit
|
||||||
|
mouseover = mouseover and UnitCanAssist("player", mouseover) and UnitName(mouseover)
|
||||||
|
|
||||||
local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
||||||
|
|
||||||
spell_queue[1] = effect
|
spell_queue[1] = effect
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ pfUI:RegisterModule("mouseover", "vanilla", function ()
|
|||||||
func()
|
func()
|
||||||
else
|
else
|
||||||
-- write temporary unit name
|
-- write temporary unit name
|
||||||
pfUI.uf.mouseover.name = UnitName(unit)
|
pfUI.uf.mouseover.unit = unit
|
||||||
|
|
||||||
-- cast without self cast cvar setting
|
-- cast without self cast cvar setting
|
||||||
-- to allow spells to use spelltarget
|
-- to allow spells to use spelltarget
|
||||||
@@ -83,7 +83,7 @@ pfUI:RegisterModule("mouseover", "vanilla", function ()
|
|||||||
if SpellIsTargeting() then SpellStopTargeting() end
|
if SpellIsTargeting() then SpellStopTargeting() end
|
||||||
|
|
||||||
-- remove temporary mouseover unit
|
-- remove temporary mouseover unit
|
||||||
pfUI.uf.mouseover.name = nil
|
pfUI.uf.mouseover.unit = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if restore_target then
|
if restore_target then
|
||||||
|
|||||||
Reference in New Issue
Block a user