libpredict: check for mouseover before using it

This commit is contained in:
shagu
2023-03-23 09:29:12 +01:00
parent 863c17cc1a
commit 337a1b9519
+1 -1
View File
@@ -320,7 +320,7 @@ 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.unit
local mouseover = pfUI and pfUI.uf and pfUI.uf.mouseover 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")